MCPcopy Create free account
hub / github.com/benbjohnson/immutable / BenchmarkSortedMap_Delete

Function BenchmarkSortedMap_Delete

immutable_test.go:2322–2335  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2320}
2321
2322func BenchmarkSortedMap_Delete(b *testing.B) {
2323 const n = 10000
2324
2325 m := NewSortedMap[int, int](nil)
2326 for i := 0; i < n; i++ {
2327 m = m.Set(i, i)
2328 }
2329 b.ReportAllocs()
2330 b.ResetTimer()
2331
2332 for i := 0; i < b.N; i++ {
2333 m.Delete(i % n) // Do not update map, always operate on original
2334 }
2335}
2336
2337func BenchmarkSortedMap_Iterator(b *testing.B) {
2338 const n = 10000

Callers

nothing calls this directly

Calls 2

SetMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…