From b13e8d7057284885a4a1de5480b6689f0979c46d Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 31 Jul 2026 18:10:56 -0400 Subject: [PATCH] test(thumbhash): drop the shipped-vs-reference benchmark The two-pass rewrite's advantage over the naive port is already recorded in its commit message; carrying the benchmark to re-derive it has no ongoing use. reference_test.go stays: besides the benchmark baseline it holds the differential oracle the golden-vector and randomised specs assert against. --- .../artwork/thumbhash/thumbhash_bench_test.go | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 core/artwork/thumbhash/thumbhash_bench_test.go diff --git a/core/artwork/thumbhash/thumbhash_bench_test.go b/core/artwork/thumbhash/thumbhash_bench_test.go deleted file mode 100644 index ba31cfae9..000000000 --- a/core/artwork/thumbhash/thumbhash_bench_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package thumbhash_test - -import ( - "testing" - - "github.com/navidrome/navidrome/core/artwork/thumbhash" - "github.com/navidrome/navidrome/tests" -) - -// BenchmarkEncodeVsReference pins the two-pass separable encoder against the naive reference port -// it replaced. referenceEncode is test-only, so this cannot live beside the cross-encoder -// benchmark in core/artwork. -func BenchmarkEncodeVsReference(b *testing.B) { - const size = 100 - img := tests.GradientImage(size) - pix := make([]byte, 0, size*size*4) - for y := range size { - pix = append(pix, img.Pix[y*img.Stride:y*img.Stride+size*4]...) - } - - b.Run("shipped", func(b *testing.B) { - b.ReportAllocs() - for b.Loop() { - if _, err := thumbhash.Encode(img); err != nil { - b.Fatal(err) - } - } - }) - - b.Run("reference", func(b *testing.B) { - b.ReportAllocs() - for b.Loop() { - _ = referenceEncode(size, size, pix) - } - }) -}