diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2026-06-12 21:06:51 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2026-06-12 21:06:51 -0700 |
| commit | e384a47e508a114bdfdda9b5356f4887ba853335 (patch) | |
| tree | 6d2d8755b0476e1304eccd7c5e5b558e1cf66b97 /icat/bench_test.go | |
| parent | 964f10beb2aab4fb831da44e3c56e89f2d7382c3 (diff) | |
| download | imgutil-e384a47e508a114bdfdda9b5356f4887ba853335.tar.zst | |
Move icat into a subdirectory
Diffstat (limited to 'icat/bench_test.go')
| -rw-r--r-- | icat/bench_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
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) + } +} |
