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

Function benchmarkOrderedMapString_GetElement

v2/orderedmap_test.go:655–667  ·  view source on GitHub ↗
(multiplier int)

Source from the content-addressed store, hash-verified

653}
654
655func benchmarkOrderedMapString_GetElement(multiplier int) func(b *testing.B) {
656 m := orderedmap.NewOrderedMap[string, bool]()
657 a := "12345678"
658 for i := 0; i < 1000*multiplier; i++ {
659 m.Set(a+strconv.Itoa(i), true)
660 }
661
662 return func(b *testing.B) {
663 for i := 0; i < b.N; i++ {
664 m.GetElement(a + strconv.Itoa(i%1000*multiplier))
665 }
666 }
667}
668
669func BenchmarkOrderedMapString_GetElement(b *testing.B) {
670 benchmarkOrderedMapString_GetElement(1)(b)

Callers 1

Calls 2

SetMethod · 0.95
GetElementMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…