3 ms·
I saw that integer overflow has been revised: it now defaults to checking overflow in unoptimized builds. I got a little nervous about this when reading the pe
by haberman 12y ago
I saw that integer overflow has been revised: it now defaults to checking overflow in unoptimized builds. I got a little nervous about this when reading the performance-related objections of @thestinger here: https://github.com/rust-lang/rfcs/pull/560 https://github.com/rust-lang/rfcs/pull/560
At least optimized builds aren't affected, but it sounds like lots of code (including Rust nightlies) aren't built optimized.
- kibwen 12y agoThe nightlies are built with optimizations. And trust me, nobody's going to be distributing Rust binaries that weren't built with optimizations because Rust code built without optimizations has performance on par with Ruby rather than C++ (LLVM's optimization passes do a hell of a good job).
- haberman 12y agoAh sorry, my mistake. I think I had optimized builds confused with "ndebug" builds. But it sounds like only ndebug builds disable overflow checks, and Rust nightlies don't use ndebug.
- baq 12y agothestinger seems to have a kernel hacker or embedded systems attitude, which is probably lower than 1% of all use cases; that's not to say it's not important, but he's generated an unproportional amount of, let's say, loud signal.
- nikomatsakis 12y agoThe final draft made an effort to address those concerns -- but also they are completely inapplicable to optimized builds, as kibwen points out. (And if you care how fast your code runs, you really do want optimizations...)
- haberman 12y agoAFAICS these concerns apply even to optimized builds unless they are also "ndebug", right?
- mrec 12y agoThere's a discussion going on right now about whether the Rust compiler should optimize by default: http://internals.rust-lang.org/t/optimizing-by-default/1532 http://internals.rust-lang.org/t/optimizing-by-default/1532