Skip to content

Commit

Permalink
benchmark user session hash function - to help with string casting ti…
Browse files Browse the repository at this point in the history
…cket
  • Loading branch information
joshblakeley committed May 10, 2018
1 parent 1c01ddc commit 10c9edf
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions user/session_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package user

import (
"testing"
)

func BenchmarkHash(b *testing.B) {
s := SessionState{
Allowance: 1000.0,
Rate: 1000.0,
Per: 1,
Expires: 1458669677,
QuotaRemaining: 1000,
QuotaRenewalRate: 3600,
}

b.ReportAllocs()
for i := 0; i < b.N; i++ {
{
s.Hash()
}
}
}

0 comments on commit 10c9edf

Please sign in to comment.