3 ms·
I'm positively surprised that Rust does so well. Not only the performance results are good, I also like the brevity and elegance of the code. The only downside
by weinzierl 10y ago
I'm positively surprised that Rust does so well.
Not only the performance results are good, I also like
the brevity and elegance of the code.
The only downside is that the examples don't work out of the box, but require an external library.
- steveklabnik 10y agoYeah it's true. This is just true of Rust in general; we've chosen to have a relatively small standard library. At the same time, one bit that the post didn't talk about (and for good reason, it's not the point of the post) is that a strength of Rust is that Rayon enjoys the same safety guarantees as the threading stuff that _is_ built into the standard library, thanks to the trait system. Rayon will still prevent data races at compile time, just like all Rust code.
- smitherfield 10y agoBut, for fairness' sake, shouldn't he have made sure LLVM wasn't using SIMD instructions for the Rust version?
- jackmott 10y agoi did, it isnt. or to be more precise it use sse adds and muls but only 1 lane the same as all the oyher 64 bit compilers in the comparison, so it isnt vectorized. you can get rust to vectorize it with unsafe intrinsics if you use the nightly build. im told better support is coming
- steveklabnik 10y agoYup! There's some technical reasons why it isn't in stable yet, but it's not an inherent problem, just needs someone to do the work. It is a thing we care about though, since speed is a major goal of Rust.
- chrismorgan 10y ago… an external library that is really easy to add. One line to Cargo.toml (plus another, “[dependencies]”, if you don’t have any dependencies already), one line to src/lib.rs and one line importing the appropriate trait to any module you wish to use `.par_iter()` in.
- jackmott 10y agoI did put it below Java on the table because it wasn't build in, but yes, the experience of adding it was very easy. I learned Rust...well I Wouldn't even say I have learned it yet. Didn't have any trouble. SIMDArray for F#/C# will be similarly easy when it is a nuget package. It just puts extension methods on Array.