test(bench): inject fake CPU regression to validate detection pipeline#66
Closed
sedghi wants to merge 2 commits into
Closed
test(bench): inject fake CPU regression to validate detection pipeline#66sedghi wants to merge 2 commits into
sedghi wants to merge 2 commits into
Conversation
Introduced a block of code across multiple decoder and encoder implementations to create a controlled CPU load, allowing for the detection of performance regressions in the benchmark pipeline. This block is marked for removal before merging.
Merging this PR will degrade performance by 63.87%
|
3 tasks
#67 landed on main and produced the first CodSpeed baseline (run 26167789689). Re-running codspeed-bench on this PR so the sticky comment can flip from "Congrats!" to a real before/after table with the fake-regression deltas highlighted on every codec. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FAKE_REGRESSIONCPU-burn block at the top of every codec'sdecode()/encode()— 5 wasm packages (charls, openjpeg, openjphjs, libjpeg-turbo-8bit, libjpeg-turbo-12bit) and 2 pure-JS packages (little-endian, big-endian).mainfor every codec. Do not merge — this is a one-off validation branch.What the burn does
volatile double burn = (burn + i) * 1.0000001.volatileforces a load/store per iter so the compiler can't fold it; expect a few ms of added CPU per call.globalThis.__fakeRegressionBurnso V8 can't DCE it. Sanity-checked locally — adds ~0.1 ms perdecode()on top of a sub-0.05 ms baseline.Test plan
grep -rln "FAKE_REGRESSION" packagesand delete each block (begin/end markers make this a one-shot cleanup)🤖 Generated with Claude Code