Live data from Hacker News

Saved by the compiler: Parallelizing a loop with Rust and rayon

blog.faraday.io

1–10 of 33 posts

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#2
Author here. I'm happy to answer questions!

I don't have any performance numbers for this loop because it was already very fast. This was just a warm-up exercise before trying to parallelize more complicated loops.

My experience with Rust has been interesting. On the one hand, if you compare Rust to Ruby or JavaScript, there really is a "Rust tax"—you have to think about ownership and references and types. But Rust pays me back by making refactoring very easy, and by catching some surprisingly subtle errors at compile time. Plus, I really like Cargo and the crates.io ecosystem.

Rust might not be a good match for every project or every programmer, but I'm really enjoying it for low-level, high-performance code.

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#3
A while back I did a whirlwind tour trying out different parallel looping abstractions in different languages, comparing their performance and ease of use. Rust+Rayon was one of the best. Simple code, fast runtime: https://jackmott.github.io/programming/2016/08/30/think-befo...

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#4
post #2

Author here. I'm happy to answer questions! I don't have any performance numbers for this loop because it was already very fast. This was just a warm-up exercise before trying to parallelize more complicated loops. My experience with Rust has been interesting. On the one hand, if you compare Rust to Ruby or JavaScript, there really is a "Rust tax"—you have to think about ownership and references and types. But Rust p…

A huge payoff that Rust provides vs Ruby or JavaScript is when writing development tools. It saves so much time and trouble to install a binary than to try and get someone to download the right version of Ruby, gem install, etc. Rust, while having its tax, is really great about telling you why your code won't compile and keeping you from footgunning yourself.

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#5
Your homepage crashed my browser. Not sure what you've got going on there. :/

Nice name but how does it relate to your product? I assume it refers to Michael Faraday.

I have a bit of history about him and how he compares to Tesla, along with a tour of monuments to him in London here: https://unop.uk/faraday-tour

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#6

Your homepage crashed my browser. Not sure what you've got going on there. :/ Nice name but how does it relate to your product? I assume it refers to Michael Faraday. I have a bit of history about him and how he compares to Tesla, along with a tour of monuments to him in London here: https://unop.uk/faraday-tour

Maybe you should switch to a browser written in Rust.

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#7
post #6

Your homepage crashed my browser. Not sure what you've got going on there. :/ Nice name but how does it relate to your product? I assume it refers to Michael Faraday. I have a bit of history about him and how he compares to Tesla, along with a tour of monuments to him in London here: https://unop.uk/faraday-tour

Maybe you should switch to a browser written in Rust.

Ironically, it is that browser.

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#9

Your homepage crashed my browser. Not sure what you've got going on there. :/ Nice name but how does it relate to your product? I assume it refers to Michael Faraday. I have a bit of history about him and how he compares to Tesla, along with a tour of monuments to him in London here: https://unop.uk/faraday-tour

> Your homepage crashed my browser.

Ouch. Sorry to hear that. What browser and version were you running? I'll file an issue.

I asked our CEO where the name came from, and he said that Faraday is famous for being an experimentalist, which ties into our predictive modeling. (We also have lots of customers in the residential solar industry.)

Re: Saved by the compiler: Parallelizing a loop with Rust and rayon

#10
post #9

Your homepage crashed my browser. Not sure what you've got going on there. :/ Nice name but how does it relate to your product? I assume it refers to Michael Faraday. I have a bit of history about him and how he compares to Tesla, along with a tour of monuments to him in London here: https://unop.uk/faraday-tour

> Your homepage crashed my browser. Ouch. Sorry to hear that. What browser and version were you running? I'll file an issue. I asked our CEO where the name came from, and he said that Faraday is famous for being an experimentalist, which ties into our predictive modeling. (We also have lots of customers in the residential solar industry.)

I wouldn't worry, it's heavily customised. If you tested in all the main browsers you're probably fine.

I suspect it was olark, as I can't see anything else obvious. That screenshot image is pretty heavyweight too, I can see it downloading.

Post reply on HN