Skip to content

fix(skills): misleading DCE advice in setup-harness#350

Open
SuperMuel wants to merge 1 commit into
fix-ci-rustup-macosfrom
fix/skill-pedantic-not-for-dce
Open

fix(skills): misleading DCE advice in setup-harness#350
SuperMuel wants to merge 1 commit into
fix-ci-rustup-macosfrom
fix/skill-pedantic-not-for-dce

Conversation

@SuperMuel
Copy link
Copy Markdown

@SuperMuel SuperMuel commented May 14, 2026

The skill told users to use benchmark.pedantic() in Python to prevent dead code elimination, like black_box() in Rust. Two problems with that.

benchmark.pedantic does not prevent dead code elimination. It just lets you set rounds, iterations, and a setup function for the benchmark.

CPython does not delete unused function calls. It can't know if a function has side effects, so it always runs it. Pure-Python benchmarks do not need a black_box.

The new wording only mentions compiled languages and uses the right name for each one.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 14, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 7 untouched benchmarks


Comparing fix/skill-pedantic-not-for-dce (c12d934) with fix-ci-rustup-macos (0d87670)

Open in CodSpeed

SuperMuel added a commit that referenced this pull request May 14, 2026
Caught by the trailing-whitespace pre-commit hook on PR #350.
@SuperMuel SuperMuel requested a review from art049 May 14, 2026 21:29
@SuperMuel SuperMuel force-pushed the fix/skill-pedantic-not-for-dce branch from d395403 to 27bd3d0 Compare May 16, 2026 21:03
@SuperMuel SuperMuel changed the base branch from main to fix-ci-rustup-macos May 16, 2026 21:03
`benchmark.pedantic` is not a dead-code-elimination tool; it controls
the measurement loop. CPython doesn't perform the kind of DCE that
`black_box` guards against in compiled languages, so pure-Python
benchmarks don't need an equivalent. List the actual primitives for
the languages that do (C++: DoNotOptimize, JMH: Blackhole.consume).
@SuperMuel SuperMuel force-pushed the fix/skill-pedantic-not-for-dce branch from 27bd3d0 to c12d934 Compare May 16, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant