diff --git a/docs/PERFORMANCE.md b/docs/PERFORMANCE.md index 3ec6b66..cf80910 100644 --- a/docs/PERFORMANCE.md +++ b/docs/PERFORMANCE.md @@ -208,6 +208,16 @@ And the fixture now survives: `tools/benchmark-fixture.sh --count 20000` reuses at least that many files, and `--fresh` rebuilds it. Building it takes about half an hour through MIUI's storage layer, which is the whole reason to keep it. +**Why it is kept on the device rather than shipped as an archive.** The obvious refinement — tar the folder +once, push it, extract it on a fresh device — was measured and does not help: 1 000 empty files take 32.8 s +to create with the shell loop and **39.6 s** to extract from a tarball on the same phone. The cost is a +per-file round trip into the storage layer, not the bytes or the source (the tarball itself is 7 KB for +1 000 files, ~150 KB for 20 000). `.nomedia` in the folder, which would keep the media scanner away, made +creation *slower* (46.8 s), so the scanner was not the culprit either. + +What that leaves is: reuse the folder that is already there, and if a device is wiped, build the size you +actually need — 1 000 takes half a minute, 5 000 a few minutes, 20 000 half an hour. + Building that fixture is the expensive part, not measuring it: 20 000 files took about thirty minutes through MIUI's storage layer (`: >` in a loop), against roughly four minutes of benchmark on top. Worth knowing before anyone re-creates it, and an argument for the fixture being built once and kept.