Repository navigation
Skip unit-test harnesses when building benchmarks - #9158
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@youknowone @ShaharNaveh does this make sense? |
|
NOTE: I think CI should fail if the CodSpeed action didn't roll the same machine as baseline. |
I've made that change and pushed it to this PR in 8c41217. I checked the workflow's YAML syntax but haven't run it in CI yet. What changed in
Trade-offs to keep in mind:
This is unrelated to the build-memory change, so if you'd prefer to keep the PR focused, I can move it to its own PR. Comment Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
Revert the previous commit. I will iterate on my idea later. |
I reverted 8c41217 in f5379b2 and pushed it to this PR. Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
Could you please rebase this branch onto a fresh copy of |
f5379b2 to
e933b95
Compare
I rebased the branch onto the latest
If you'd like a cleaner history, comment Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
@codspeedbot squash this PR into a single commit |
cargo bench and cargo codspeed build select every target with bench = true. That includes the library and binary targets, so the build also compiled the library unit-test harness as an extra LTO-linked copy of the interpreter that no benchmark runs. Mark them bench = false so only the criterion benchmarks (and the binary they depend on) are built.
e933b95 to
3636128
Compare
I squashed the PR into one commit, 3636128 (Skip unit-test harnesses when building benchmarks), and force-pushed it.
CI will run on the new head. Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Follow-up to #9151, where the CodSpeed job failed in a way unrelated to that PR.
Problem
The CodSpeed workflow often dies in Build the benchmark targets with
The runner has received a shutdown signal(exit 143). Over the last ~200 runs, 18 runs failed this way, mostlymainpushes, including #9151 and the two most recentmainruns. In each case the build was killed while compiling the finalrustpythontargets.cargo codspeed build(likecargo bench) selects every target that hasbench = true, and both the library and the binary have it by default. As a result, the build makes 4 LTO-linked copies of the interpreter with full debug info, about 350 MB each:executionbenchmicrobenchmarksbenchrustpythonbinary (Cargo builds it automatically for benches)rustpythonlibrary unit-test harness (--test)Each of these LTO compilations takes about 5 GB RSS and several minutes on the 2-core, 16 GB
ubuntu-latestrunner.Change
bench = falseon[lib]and[[bin]]. Only the criterion benches and the binary they depend on are built now.cargo testand the measured benchmarks are unchanged.Local measurement
cargo-codspeed 5.0.3,
-j 2(same as CI), dependencies cached, rebuilding therustpythoncrate's targets:cargo codspeed buildwall timeThe build is now about 3 minutes shorter, so it spends less time near its memory peak. The peak itself did not drop, because the two bench binaries still compile and link at the same time (the difference above is sampling noise). If the shutdowns continue after this change, the next step would be to stop those two links from overlapping, or to move to a larger runner.