by piyh · 3y ago · 0 comments
Multiprocessing on Python works great and isn’t even very hard if you use say async_apply with a Pool.
Comparing single-threaded Python with multiprocesssing in Language X is unfair if not disingenuous.
Multiprocessing works great if you don't really need a shared memory space for your task. If it's very loosely coupled, that's fine.
But if you use something that can benefit from real threading, Python clamps you to about 1.5-2.5 cores worth of throughput very often.
Nothing preventing something like Mojo to also use those same 32 threads but with 10-100x the performance instead.
In this way we can justify rewriting stuff in rust to our bosses!
If we write decent python, and perhaps even replace 1 line to use pypy, the speedup won't be impressive and we won't get to play with rust!