From e384a47e508a114bdfdda9b5356f4887ba853335 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 12 Jun 2026 21:06:51 -0700 Subject: Move icat into a subdirectory --- icat/bench_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 icat/bench_test.go (limited to 'icat/bench_test.go') diff --git a/icat/bench_test.go b/icat/bench_test.go new file mode 100644 index 0000000..1e79a10 --- /dev/null +++ b/icat/bench_test.go @@ -0,0 +1,20 @@ +package main + +import ( + "cmp" + "math/rand/v2" + "testing" +) + +func BenchmarkQuickSelect(b *testing.B) { + rng := rand.New(rand.NewPCG(0, 0)) + myTestCase := make([]int, 3840*2160) + for b.Loop() { + b.StopTimer() + for i := range myTestCase { + myTestCase[i] = rng.Int() + } + b.StartTimer() + quickSelect(myTestCase, len(myTestCase)/2, cmp.Compare) + } +} -- cgit v1.3.1