MCPcopy Create free account
hub / github.com/elliotchance/orderedmap / benchmarkMapString_Has

Function benchmarkMapString_Has

orderedmap_test.go:755–767  ·  view source on GitHub ↗
(multiplier int)

Source from the content-addressed store, hash-verified

753}
754
755func benchmarkMapString_Has(multiplier int) func(b *testing.B) {
756 m := make(map[string]bool)
757 a := "12345678"
758 for i := 0; i < 1000*multiplier; i++ {
759 m[a+strconv.Itoa(i)] = true
760 }
761
762 return func(b *testing.B) {
763 for i := 0; i < b.N; i++ {
764 _ = m[a+strconv.Itoa(i%1000*multiplier)]
765 }
766 }
767}
768
769func BenchmarkMapString_Has(b *testing.B) {
770 benchmarkMapString_Has(1)(b)

Callers 1

BenchmarkMapString_HasFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…