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

Function BenchmarkMap_Delete

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

Source from the content-addressed store, hash-verified

1428}
1429
1430func BenchmarkMap_Delete(b *testing.B) {
1431 const n = 10000000
1432
1433 builder := NewMapBuilder[int, int](nil)
1434 for i := 0; i < n; i++ {
1435 builder.Set(i, i)
1436 }
1437 b.ReportAllocs()
1438 b.ResetTimer()
1439
1440 m := builder.Map()
1441 for i := 0; i < b.N; i++ {
1442 m.Delete(i % n) // Do not update map, always operate on original
1443 }
1444}
1445
1446func BenchmarkMap_Iterator(b *testing.B) {
1447 const n = 10000

Callers

nothing calls this directly

Calls 3

MapMethod · 0.80
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…