Hacker News new | ask | show | jobs
by jasondavies 4307 days ago
It's probably to avoid dead-code elimination, which would defeat the purpose of the benchmark. The rust benchmarks use test::black_box [0], which does the same thing, so there's no unfair advantage there.

[0]: http://doc.rust-lang.org/test/fn.black_box.html

1 comments

But it appears that the Rust code is avoiding optimization over f() whereas for C code `asm("");` is inside iteration loop.