You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add sinks to benchmarks to prevent smart tools eliminating benchmarked code (#1040)
In `binary_decode_packed` benchmarks we used "sink" variables to write the
decoded values, and printed these sinks at the end to make sure they're not
dropped.
Do the same in the rest of the benchmarks to make sure no code is eliminated by
a sufficiently smart compiler or VM.
Just as a sanity check I compared the numbers before and after this change,
when compiled to Wasm with `-O2`. The numbers do not change in a consistent
(reproducible) and significant way. It's still good to be safe and use the
benchmark results to avoid dropping code.
0 commit comments