5 ms·
It also runs actually in parallel, unlike the Rust and JS ones
by ilyt 3y ago
It also runs actually in parallel, unlike the Rust and JS ones
- tialaramex 3y agoThe Rust threaded solution obviously produces actual threads, which will run "actually in parallel" if that is technically possible on your system. The Rust tokio solution will use tokio's runtime which automatically spawns an appropriate amount of worker threads to parallelize your async tasks (by default it asks the OS how many CPUs there are and creates one such thread for each CPU). The async-std implementation is roughly similar.
- kibwen 3y agoThe Rust version is running in parallel. Tokio's runtime is parallel by default.