aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/map-delete/pds.go
blob: 1e2771ccee8f1cf07173f7a48e04fbb6c834d4a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package pds

import (
	"flag"
)



var nFlag = flag.Int(
	"n",
	1_000_000,
	"The number of iterations to execute",
)

func MainTest() {
	flag.Parse()
	n := *nFlag

	builder := NewMapBuilder[int, int](nil)
	for i := 0; i < n; i++ {
		builder.Set(i, i)
	}

	m := builder.Map()
	for i := 0; i < n; i++ {
		m.Delete(i) // Do not update map, always operate on original
	}
}