Skip to content

Commit 03bc3ca

Browse files
committed
Time a chain of modules with the base's and the head's build systems
Why: A change to the build's scheduling, such as starting a module once the interfaces it reads are final, does the same work sooner. Counting allocated words and instructions can only show what such a change costs, never what it saves. `time <base checkout> <head checkout> <out.json>` builds a generated project of 150 modules in a chain, each using the one before it, and a module beside each, clean with the two build systems in turn on the default number of worker domains: one build each that isn't counted, then 10 rounds, the order alternating each round. `compare --timings` adds a section to the report with the base's and the head's median times and the median of the head's time over the base's in the same round, with a 95% confidence interval from a percentile bootstrap of the rounds with a fixed seed. The section never counts as a regression or an improvement; when the times' file is missing or can't be read, it says they weren't measured. In CI, the step runs after both measurements, each build may take 2 minutes and the whole command 10, and a failure only leaves the times out. Locally, with load around 5 to 9 on 8 cores, the ratio was 0.695 (0.646 to 0.825) for the pull request that starts dependents once a module's interface is final, 0.991 (0.948 to 1.055) for one that only changes namespaced packages, and 0.965 (0.921 to 1.078) with the same build system on both sides. The command took about 45 seconds. Signed-off-by: Jono Prest <jjprest@gmail.com>
1 parent a146443 commit 03bc3ca

4 files changed

Lines changed: 472 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,17 @@ jobs:
467467
}
468468
measure "$RUNNER_TEMP/base" "$RUNNER_TEMP/base.json"
469469
measure "$GITHUB_WORKSPACE" "$RUNNER_TEMP/head.json"
470+
# Wall time, with the two build systems taking turns on this
471+
# runner. It only indicates a change that counting can't show, so
472+
# a failure, or a run longer than 10 minutes, leaves it out of the
473+
# report and fails nothing.
474+
timeout --kill-after=30s 10m \
475+
node scripts/compilerBenchmarks.js time "$RUNNER_TEMP/base" "$GITHUB_WORKSPACE" \
476+
"$RUNNER_TEMP/timings.json" || echo "::warning::The wall-time benchmark failed."
470477
status=0
471478
report="$RUNNER_TEMP/benchmarks-report.md"
472479
node scripts/compilerBenchmarks.js compare "$RUNNER_TEMP/base.json" "$RUNNER_TEMP/head.json" \
473-
--threshold 1 --summary "$report" || status=$?
480+
--threshold 1 --summary "$report" --timings "$RUNNER_TEMP/timings.json" || status=$?
474481
cat "$report" >> "$GITHUB_STEP_SUMMARY"
475482
printf '\nPull request %s compared with base %s in [this run](%s).\n' \
476483
"$(git rev-parse --short=9 HEAD^2)" "$(git rev-parse --short=9 HEAD^1)" "$RUN_URL" \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- Count the words the build allocates on generated projects in the CI benchmarks: many modules using little of a few large dependencies, and a namespaced package of 1,000 modules.
2+
- Time clean builds of a generated chain of modules with the base's and the head's build systems in turn in the CI benchmarks, and report the median ratio with a 95% confidence interval. The times are only indicative and never fail the job.

0 commit comments

Comments
 (0)