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

Function BenchmarkSortedMapBuilder_Delete

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

Source from the content-addressed store, hash-verified

2373}
2374
2375func BenchmarkSortedMapBuilder_Delete(b *testing.B) {
2376 const n = 1000000
2377
2378 builder := NewSortedMapBuilder[int, int](nil)
2379 for i := 0; i < n; i++ {
2380 builder.Set(i, i)
2381 }
2382 b.ReportAllocs()
2383 b.ResetTimer()
2384
2385 for i := 0; i < b.N; i++ {
2386 builder.Delete(i % n)
2387 }
2388}
2389
2390func ExampleSortedMap_Set() {
2391 m := NewSortedMap[string, any](nil)

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…