Re:Why is Rust slightly slower than C?
by xigency on Wednesday September 11, 2019 @11:38PM
(#20947701)
Is there an element of runtime correctness and safety as well? Are we comparing programs that have proper bounds checking to ones that don't?
[ Parent
| on HN ]
Re:Why is Rust slightly slower than C?
by ncmncm on Thursday September 12, 2019 @02:06AM
(#20948490)
One hopes that the optimizer has arranged to check the bounds at the start of the loop, and not in it. Apparently Rust's doesn't, yet, but it seems usually to happen to overlap the checking it does with other stalls, so it might not usually matter much.
Re:Why is Rust slightly slower than C?
by kzrdude on Thursday September 12, 2019 @02:18AM
(#20948558)
The actual bounds checking instructions are often negligible in terms of overhead, but it can inflict damage by inhibiting other optimizations and loop optimizations, like reduction or vectorization.
Re:Why is Rust slightly slower than C?
by ncmncm on Thursday September 12, 2019 @02:26AM
(#20948599)
Low-hanging fruit. But there are still bigger fish to fry.
Lower-hanging bigger fish?
Rust isn't mature yet. Give it ten years. It will either exceed C performance, or fade away. It's still too early to say which.
Re:Why is Rust slightly slower than C?
by kzrdude on Thursday September 12, 2019 @10:59AM
(#20952219)
What's the bigger things that need solving in Rust?