News for hackers. Stuff that matters.
Re:Rust is Software's Salvation by jdright on Thursday December 29, 2016 @06:24PM (#13281120)
And this is getting nauseating even to these wanting to give it a try. I'm in the step of walking away and forget about it until the dirt settles down (and it becomes at least as fast as C/C++ or... even Go)
Re:Rust is Software's Salvation by steveklabnik on Thursday December 29, 2016 @06:31PM (#13281168)
In general, if Rust is significantly slower than equivalent C or C++, that's a bug. We track them. Please file them.

Rust should be roughly the same, speed-wise.

Re:Rust is Software's Salvation by mmstick on Thursday December 29, 2016 @10:05PM (#13282202)
I was competing against some C and C++ software developers in Advent of Code with efficient solutions, and my Rust solutions came out faster each time. Might want to check your facts.
Re:Rust is Software's Salvation by jdright on Friday December 30, 2016 @06:13PM (#13288343)
That doesnt mean anything. Try a little real software for instance.
Re:Rust is Software's Salvation by mmstick on Saturday December 31, 2016 @01:27AM (#13289825)
Re:Rust is Software's Salvation by jdright on Saturday December 31, 2016 @11:00AM (#13291538)
No, like: crypto, math, compression, encoding/decoding. Any example?
Re:Rust is Software's Salvation by burntsushi on Saturday December 31, 2016 @01:04PM (#13292211)
Re:Rust is Software's Salvation by jdright on Saturday December 31, 2016 @01:24PM (#13292320)
Very good example in fact. Seems roughly the same.
Re:Rust is Software's Salvation by burntsushi on Friday December 30, 2016 @10:28PM (#13289279)
Like ripgrep?
Re:Rust is Software's Salvation by jdright on Saturday December 31, 2016 @10:53AM (#13291496)
Question, grep is multi-threaded?
Re:Rust is Software's Salvation by burntsushi on Saturday December 31, 2016 @01:04PM (#13292205)
GNU grep is not multi-threaded.

Since you chose to be cute, I'm going to take a guess that you think this means the comparison between the tools is unfair. If that's an accurate interpretation, then I will say that your question is irrelevant because ripgrep is faster or as fast as GNU grep on benchmarks using a single thread too. In fact, that's the whole point! It says so right in the project's README.

http://blog.burntsushi.net/ripgrep/#single-file-benchmarks

Re:Rust is Software's Salvation by jdright on Saturday December 31, 2016 @01:22PM (#13292307)
Ok, interesting analysis. I will look more on Rust and maybe try something myself. But by reading your other posts about optimizing Rust to do search, it seems to require a lot of experience to tune Rust code.
Re:Rust is Software's Salvation by burntsushi on Saturday December 31, 2016 @01:33PM (#13292368)
Building ripgrep did require a lot of experience, indeed, but it had almost nothing to do with Rust. The experience is in text search specifically, which you'll need regardless of the language you're using. If you look at the regex crate for example, there's basically no use of unsafe at all. The only use is to elide bounds checks in some very carefully crafted tight loops. But again, most of that work was done irrespective of Rust and just figuring out the right way to unroll the DFA loop(s).

Optimization tricks in Rust are the same as you'll find in C++. It might be worth you comparing the C++ implementation of Snappy with my Rust implementation, for example. You'll see the same kinds of tricks employed in C++ as in Rust (avoiding memcpy in favor of unaligned loads/stores).