-
Notifications
You must be signed in to change notification settings - Fork 121
feat: @bench.T::keep
#1992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: @bench.T::keep
#1992
Conversation
Missing implementation of OpaqueValue trait for valuesCategory impl[T] OpaqueValue for T {} Reasoning Unclear initialization of storage field with unit valueCategory { buffer, summaries, storage: null as &OpaqueValue } Reasoning touch_storage function purpose is not well documentedCategory ///|
/// Internal function to prevent compiler warnings about unused storage field.
/// Called after benchmarking to ensure kept values aren't optimized away. Reasoning |
Pull Request Test Coverage Report for Build 6427Details
💛 - Coveralls |
There is no cleanup for |
It will be recycled after |
30df449
to
3041079
Compare
the windows CI should be fixed after next release |
Some optimizations may eliminate the calculation that doesn't have side effects. #1974
A special function can be used to block such an optimization.
In other PLs or libraries,
black_box
in Rust,DoNotOptimize
in Google Benchmarkruntime.Keep
it's a proposal for Go. Partially replaced byruntime.KeepAlive
with a poor semantics.Example:
from
to