What can cause pessimization like std::hint::black_box for pass-by-value?

· Users Rust Lang · April 28, 2026, 3:23 a.m.
Summary
The blog post discusses benchmarks comparing pass-by-value and pass-by-reference for Copy types in Rust, highlighting that using std::hint::black_box can lead to significant performance differences, specifically showing that passing by value can be 70% slower than passing by reference in certain situations. The author is concerned about potential pessimization and seeks insights on the trade-offs involved.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →