News for hackers. Stuff that matters.
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by marvy on Saturday July 09, 2016 @02:55PM (#12062747)
This means that Rust has experience with wraparound and with panics. So this question should be answerable by someone on the Rust team: how much does the check cost? A few percent? A factor of 2? Surely not more than that?
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by pcwalton on Saturday July 09, 2016 @04:22PM (#12063136)
Depends. The problem is not so much the overhead of the check itself as that it introduces a lot of control flow edges which interfere with optimizations. For example, on x86 you can kiss most uses of LEA goodbye...
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by marvy on Saturday July 09, 2016 @08:18PM (#12063968)
Sure, but when all is said and done, what's the cost? There are plenty of Rust benchmarks by now, possibly some of them are part of the test suite. How much do they slow down?