Add benchmarking suite for parallel.sh performance - #2
Merged
Merged
Conversation
The README said chains are faster without ever showing by how much. Two gantt charts now draw the same build in order and in chains, one for a build that passes and one for a build whose lint fails, and a benchmark suite puts numbers under them. bench/bench.sh describes four builds as the chains they are made of, with every step a sleep as long as that step usually takes, and runs each one twice: in declaration order, the way a set -e script runs it, and as chains. Sleeps because the shape of a build is what changes here, not the work in it, and the report says so. Four scenarios, because the gain depends entirely on the shape: two independent chains, four independent checks, a failure found early, and one step long enough that nothing can be done about it. The only assertion is that a scenario was faster in chains than in order. The times are a report, and a hosted runner is far too noisy to hold a particular number against a build. CI runs it on every push and puts the table in the run summary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bn7kapsRo75cCUfU6nfNpS
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.
This PR adds a comprehensive benchmarking suite to measure the performance gains of using
parallel.shchains versus sequential script execution.Summary
A new
bench/bench.shscript has been added that benchmarks four realistic build scenarios, comparing execution time when steps run sequentially (traditionalset -escript) versus in parallel chains. The benchmarks are integrated into the CI pipeline and documented in the README.Key Changes
New
bench/bench.sh— A POSIX shell benchmarking script that:sleepcommands to simulate build steps without competing for system resourcesREPS), time scaling (SCALE), and shell selection (SHELL_UNDER_TEST)Updated
Makefile— Addedbenchtarget to run benchmarks (not part of defaultchecktarget since it takes several minutes)Updated
.github/workflows/ci.yml— Addedbenchjob that:Updated
README.md— Added documentation including:Notable Implementation Details
sleepinstead of real work to isolate the parallelization benefit from CPU/IO contentionhttps://claude.ai/code/session_01Bn7kapsRo75cCUfU6nfNpS