4 ms·
> Go optimizes out checks for the simple cases; Rust should and probably will in time. rustc uses the industrial strength LLVM optimiser, which is perfectly ca
by dbaupp 12y ago
> Go optimizes out checks for the simple cases; Rust should and probably will in time.
rustc uses the industrial strength LLVM optimiser, which is perfectly capable of elimatinating bounds checks: almost certainly more capable than the main Go compiler in any case.
This has been pointed out to you several times, and so your repeated assertions otherwise are now almost malicious. Maybe you could be more concrete (e.g. with an instance of a subscript check eliminated by the Go compiler but not rustc)?
- danieldk 12y ago"Rust essentially never wastes cycles on bounds checking thanks to the design of its iterators. The Servo team tells me that bounds checking has never shown up in any performance profiles." Source: https://news.ycombinator.com/item?id=9392131 https://news.ycombinator.com/item?id=9392131
- dbaupp 12y agoThat's... not exactly relevant. :) Rust's iterators definitely resolve a lot of problems one might have with bounds checking, but there's still times when one is essentially required to do explicit indexing (e.g. iterating down a column of a multidimensional array) but in such a way that the bounds checks should be removable. My point was that, modulo bugs, rustc (more specifically, LLVM) will eliminate such bounds checks. With or without iterators.
- Animats 12y agoI really need to write a matrix multiply and see what code Rust generates.