build(dev): generate a 50k-track library and measure a running app
Plan 007 phase 4 is verified by measurement, not by assertion, and there was no way to produce a number: the fixture library is a few dozen tracks and cannot show any of the findings. - `cmd/gentestdata -bulk N` (`make bulkdata`) writes a ~50 000-track library in 11 s / 466 MB by encoding six clips once and copying them, while still tagging every file through `backend/tagwriter` — a library the app cannot read back measures nothing. - `make sandbox-seed-bulk` seeds from it through the same script and the same discipline as any other seed: by running the app and waiting for the real scan. - `e2e/perf/measure.mjs` (`make perf LABEL=x`, `make perf-compare`) takes fourteen measurements against a running app and writes them to a gitignored `.dev/perf/<label>.json`. It wraps every bound Go method, so "did that refetch the library" is a fact rather than an inference, and records `longtask` entries, which is where a 25 MB JSON parse on the main thread shows up and nowhere else. It is not a spec and does not run in CI.
This commit is contained in:
@@ -161,7 +161,19 @@ func requireFFmpeg() error {
|
||||
// the library's cover-art deduplication is supposed to collapse into a
|
||||
// single stored blob.
|
||||
func coverJPEG(key string) ([]byte, error) {
|
||||
img := image.NewRGBA(image.Rect(0, 0, coverSizePx, coverSizePx))
|
||||
return coverJPEGSized(key, coverSizePx)
|
||||
}
|
||||
|
||||
// coverJPEGSized is coverJPEG at an explicit edge length. The bulk
|
||||
// library uses a larger one, because a 64 px cover cannot show the
|
||||
// difference between rendering the original artwork and rendering the
|
||||
// thumbnail tier that exists for the purpose.
|
||||
// coverJPEGSized is coverJPEG at an explicit edge length. The bulk
|
||||
// library uses a larger one, because a 64 px cover cannot show the
|
||||
// difference between rendering the original artwork and rendering the
|
||||
// thumbnail tier that exists for the purpose.
|
||||
func coverJPEGSized(key string, px int) ([]byte, error) {
|
||||
img := image.NewRGBA(image.Rect(0, 0, px, px))
|
||||
|
||||
// A per-key hue derived from the key's bytes, plus a diagonal
|
||||
// band, so covers are distinguishable by eye in a screenshot.
|
||||
@@ -177,8 +189,8 @@ func coverJPEG(key string) ([]byte, error) {
|
||||
A: 255,
|
||||
}
|
||||
|
||||
for y := range coverSizePx {
|
||||
for x := range coverSizePx {
|
||||
for y := range px {
|
||||
for x := range px {
|
||||
c := base
|
||||
if (x+y)%16 < 8 {
|
||||
c.R /= 2
|
||||
|
||||
Reference in New Issue
Block a user