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

Function benchmarkBigOrderedMapString_GetElement

orderedmap_test.go:1073–1087  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1071}
1072
1073func benchmarkBigOrderedMapString_GetElement() func(b *testing.B) {
1074 m := orderedmap.NewOrderedMap()
1075 a := "1234567"
1076 for i := 0; i < 10000000; i++ {
1077 m.Set(a+strconv.Itoa(i), true)
1078 }
1079
1080 return func(b *testing.B) {
1081 for j := 0; j < b.N; j++ {
1082 for i := 0; i < 10000000; i++ {
1083 m.GetElement(a + strconv.Itoa(i))
1084 }
1085 }
1086 }
1087}
1088
1089func BenchmarkBigOrderedMapString_GetElement(b *testing.B) {
1090 benchmarkBigOrderedMapString_GetElement()(b)

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…