MCPcopy
hub / github.com/cornelk/hashmap / setupHashMap

Function setupHashMap

benchmarks/benchmark_test.go:15–23  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

13const benchmarkItemCount = 1024
14
15func setupHashMap(b *testing.B) *hashmap.Map[uintptr, uintptr] {
16 b.Helper()
17
18 m := hashmap.New[uintptr, uintptr]()
19 for i := uintptr(0); i < benchmarkItemCount; i++ {
20 m.Set(i, i)
21 }
22 return m
23}
24
25func setupHaxMap(b *testing.B) *haxmap.HashMap[uintptr, uintptr] {
26 b.Helper()

Callers 2

BenchmarkReadHashMapUintFunction · 0.85

Calls 2

NewFunction · 0.92
SetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…