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
A possible improvement to the benchmark could be to change Action to take a parameter, and to tunnel the parameter value through criterion::black_box to avoid compiler optimizations based on that value.
The text was updated successfully, but these errors were encountered:
Rust and its pattern matching is fast, but not that fast ;)
Rustc 1.77 seems to be able to optimize the whole
pattern_matching
function to the equivalent ofreturn 330
.Rustc 1.78 seems to be able to do the same optimization also for the
dynamic_dispatch
version.See https://rust.godbolt.org/z/zTrzhTbze for the assembly output.
A possible improvement to the benchmark could be to change
Action
to take a parameter, and to tunnel the parameter value throughcriterion::black_box
to avoid compiler optimizations based on that value.The text was updated successfully, but these errors were encountered: