-
Notifications
You must be signed in to change notification settings - Fork 0
/
twharmongouid_test.go
42 lines (33 loc) · 1.01 KB
/
twharmongouid_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package uuid_shootout_test
import (
"testing"
"github.com/fgm/uuid_shootout"
)
func twharmonGouidBenchStrategy(b *testing.B, strategy func() string) {
count := 0
b.ResetTimer()
for i := 0; i < b.N; i++ {
count += len(strategy())
}
b.StopTimer()
// Ensure no unused data elimination.
uuid_shootout.UseInt(count)
}
func BenchmarkTwharmonGouidLCA(b *testing.B) {
twharmonGouidBenchStrategy(b, uuid_shootout.TwharmonGouidGen1LCA)
}
func BenchmarkTwharmonGouidLCAN(b *testing.B) {
twharmonGouidBenchStrategy(b, uuid_shootout.TwharmonGouidGen1LCAN)
}
func BenchmarkTwharmonGouidMCA(b *testing.B) {
twharmonGouidBenchStrategy(b, uuid_shootout.TwharmonGouidGen1MCA)
}
func BenchmarkTwharmonGouidMCAN(b *testing.B) {
twharmonGouidBenchStrategy(b, uuid_shootout.TwharmonGouidGen1MCAN)
}
func BenchmarkTwharmonGouidUCA(b *testing.B) {
twharmonGouidBenchStrategy(b, uuid_shootout.TwharmonGouidGen1UCA)
}
func BenchmarkTwharmonGouidUCAN(b *testing.B) {
twharmonGouidBenchStrategy(b, uuid_shootout.TwharmonGouidGen1UCAN)
}