4 ms·
The rust version is using multiple cpus using a pool concept (which looks a lot like the multiprocessing module from python so kudos there). But the C version i
by gigatexal 10y ago
The rust version is using multiple cpus using a pool concept (which looks a lot like the multiprocessing module from python so kudos there). But the C version is single threaded from what I can tell. So rust is safe but threaded to be faster than single threaded C which isn't that much slower. Hmm...
- scotty79 10y agoIsn't the whole point of Rust to do threaded things safely by keeping strict tabs on who owns what and for how long?
- Etzos 10y agoFrom what I can see the C version is using OpenMP and uses all of the available CPU cores.
- infogulch 10y agoThat's not true. If you look at the comparisons, the cpu time taken by C is actually more than rust, and the cpu load looks about even. Note the C version uses: #pragma omp parallel sections
- gens 10y ago>.. and the cpu load looks about even. 318% is 20% bigger then 265%.
- infogulch 10y agoAnd 5.30s is about 20% faster than 6.46s. We're just throwing around numbers now. My point was that the cpu load is "about even" compared to if the C version was single-threaded, in which case it would look more like 200-300% bigger cpu load instead of merely 20%.
- gigatexal 10y agoAhh dang I didn't know you could do compiler run parallelism.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]