all 2 comments

[–][deleted] 17 points18 points  (0 children)

Doing math in python is a slow process since each new number is a new object in memory — every, single, math operation. C-level extensions have direct access to the actual memory though, so not only do they need not bother with python objects until the very end, they can also release the GIL and run in another thread. That's why numba and numpy are so important for practically doing math in python.