Repository navigation
Run wd_cc_benchmark() benchmarks once under bazel test - #8545
Conversation
There was a problem hiding this comment.
Superseded by the review of
4d92e7cd.
This review, of 699b6fd2
✅ Approved — Small, correct change to benchmark test infrastructure with no issues found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The environment check, the order of the arguments and the dry-run early return in recordAllocationStats() all look correct.
📝 Documentation: ✅ LGTM
The updates to docs/benchmarking.md and build/AGENTS.md describe the new behaviour accurately.
Reviewed commit: 699b6fd2
wd_cc_benchmark() executables are cc_tests, so `bazel test //...` runs them, and until now they measured every benchmark as `bazel run` does, which takes long and checks nothing more. They now get their own main() (//src/workerd/tests:bench-main), which is Google Benchmark's, except that under `bazel test` it adds --benchmark_dry_run=true, so that the test runs each benchmark once, to check that it works, and measures nothing. It tells `bazel test` from `bazel run` by the environment: both set TEST_SRCDIR, and only `bazel run` sets BUILD_WORKSPACE_DIRECTORY (the cc_test env attribute would apply to `bazel run` too). The flag goes before the command line's, so that those override it. `bazel run`, and so CodSpeed, still measures. recordAllocationStats() does nothing in a dry run, which measures nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
699b6fd to
4d92e7c
Compare
There was a problem hiding this comment.
✅ Approved — Small, correct change to benchmark test infrastructure with no issues found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The environment check, the order of the arguments and the dry-run early return in recordAllocationStats() all look correct.
📝 Documentation: ✅ LGTM
The updates to docs/benchmarking.md and build/AGENTS.md describe the new behaviour accurately.
Reviewed commit: 4d92e7cd — same changes as 699b6fd2, so this is that commit's review (no new review was run; line numbers are as of 699b6fd2)
wd_cc_benchmark() executables are cc_tests, so
bazel test //...runs them, and until now they measured every benchmark asbazel rundoes, which takes long and checks nothing more.They now get their own main() (//src/workerd/tests:bench-main), which is Google Benchmark's, except that under
bazel testit adds --benchmark_dry_run=true, so that the test runs each benchmark once, to check that it works, and measures nothing. It tellsbazel testfrombazel runby the environment: both set TEST_SRCDIR, and onlybazel runsets BUILD_WORKSPACE_DIRECTORY (the cc_test env attribute would apply tobazel runtoo). The flag goes before the command line's, so that those override it.bazel run, and so CodSpeed, still measures.recordAllocationStats() does nothing in a dry run, which measures nothing.