Skip to content

Commit 1cc843e

Browse files
author
Noam Preil
committed
guid: add benchmark of direct == (Thanks Jorge!)
1 parent ee3aef3 commit 1cc843e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sttp/guid/Guid_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,16 @@ func BenchmarkEqualityCurrent(b *testing.B) {
346346
_ = equal
347347
}
348348
}
349+
350+
func BenchmarkEqualityDirect(b *testing.B) {
351+
list := []string{gs1, gs2, gs3, gs4, gs5, gs6, gsz}
352+
glist := [7]Guid{}
353+
for i := range list {
354+
glist[i], _ = Parse(list[i])
355+
}
356+
b.ResetTimer()
357+
for range b.N {
358+
equal := glist[0] == glist[1]
359+
_ = equal
360+
}
361+
}

0 commit comments

Comments
 (0)