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

Function BenchmarkMapBuilder_Delete

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

Source from the content-addressed store, hash-verified

1472}
1473
1474func BenchmarkMapBuilder_Delete(b *testing.B) {
1475 const n = 10000000
1476
1477 builder := NewMapBuilder[int, int](nil)
1478 for i := 0; i < n; i++ {
1479 builder.Set(i, i)
1480 }
1481 b.ReportAllocs()
1482 b.ResetTimer()
1483
1484 for i := 0; i < b.N; i++ {
1485 builder.Delete(i % n)
1486 }
1487}
1488
1489func ExampleMap_Set() {
1490 m := NewMap[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…