fix(skills): misleading DCE advice in setup-harness#350
Conversation
Merging this PR will not alter performance
|
Caught by the trailing-whitespace pre-commit hook on PR #350.
d395403 to
27bd3d0
Compare
c47530a to
0d87670
Compare
27bd3d0 to
c12d934
Compare
e332482 to
78b800a
Compare
`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).
c12d934 to
8bf3d7d
Compare
Greptile SummaryCorrects a single misleading line in the
Confidence Score: 5/5This is a one-line documentation fix removing factually incorrect advice; it introduces no code or behavioural changes and the new text is accurate. The change only touches documentation, removes genuinely wrong guidance, and replaces it with correct compiler-barrier references. The only minor note is that JMH appears in a skill that has no Java harness section, which could mildly confuse readers. No files require special attention; the single changed line in Important Files Changed
|
The skill told users to use
benchmark.pedantic()in Python to prevent dead code elimination, likeblack_box()in Rust. Two problems with that.benchmark.pedanticdoes 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.