←back to thread

160 points todsacerdoti | 1 comments | | HN request time: 0s | source
Show context
roca ◴[] No.41902494[source]
I think the importance of parallelism has been overlooked by the OP and most commenters here. Even laptops these days have at least 8 cores; a good scalable parallel implementation of a tool will crush the performance of any single-threaded implementation. JS is not a great language for writing scalable parallel code. Rust is. Not only do Rust and its ecosystem (e.g. Rayon) make a lot of parallel idioms easy, Rust's thread safety guarantees let you write shared-memory code without creating a maintenance nightmare. In JS you can't write such code at all.

So yes, you can do clever tricks with ArrayBuffers, and the JS VMs will do incredibly clever optimizations for you, but as long as your code is running on one core you cannot be competitive. (Unless your problem is inherently serial, but very few "tool"-type problems are.)

replies(3): >>41902969 #>>41903945 #>>41904571 #
1. Vinnl ◴[] No.41904571[source]
They acknowledge it in the comments:

> “Embarrassingly parallel” tasks definitely make a lot of sense to do in Rust.