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

Function benchmarkOrderedMapString_GetElement

orderedmap_test.go:662–674  ·  view source on GitHub ↗
(multiplier int)

Source from the content-addressed store, hash-verified

660}
661
662func benchmarkOrderedMapString_GetElement(multiplier int) func(b *testing.B) {
663 m := orderedmap.NewOrderedMap()
664 a := "12345678"
665 for i := 0; i < 1000*multiplier; i++ {
666 m.Set(a+strconv.Itoa(i), true)
667 }
668
669 return func(b *testing.B) {
670 for i := 0; i < b.N; i++ {
671 m.GetElement(a + strconv.Itoa(i%1000*multiplier))
672 }
673 }
674}
675
676func BenchmarkOrderedMapString_GetElement(b *testing.B) {
677 benchmarkOrderedMapString_GetElement(1)(b)

Callers 1

Calls 3

SetMethod · 0.95
GetElementMethod · 0.95
NewOrderedMapFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…