3 ms·
> It's easy to forget that CPython is not that optimised generally, "Not that optimised" is actually an understatement. In my experience, CPU-heavy code typica
by FartyMcFarter 5y ago
> It's easy to forget that CPython is not that optimised generally,
"Not that optimised" is actually an understatement. In my experience, CPU-heavy code typically becomes 10-100x faster if you port it from Python to a language like C (without even trying to be clever or using SIMD assembly).
- stevesimmons 5y agoOften you can put a "@numba.jit" decorator at the top of a calc-heavy function, and reclaim a good portion of C's performance. It is so simple it is definitely worth trying. I did it for Bloom tree implementation, and got to within around 3x of the C code it replaced.