-
Notifications
You must be signed in to change notification settings - Fork 4
Cython tips
Jerry Morrison edited this page Oct 9, 2019
·
5 revisions
Cython compiles Python code to machine code. It's useful tool for speeding up Python code, esp. inner loops over arrays with static types. It can even run multiple threads over code that doesn't need the gil
(Python's Global Interpreter Lock). It's in active development and heavily used by many projects.
There are other ways to speed up Python code, e.g. Nuitka, Numba, Numexpr, Pyjion, PyPy, Pyston, Pythran, and Weld, not to mention running array computations in NumPy.
Cython does a lot for you but it gets tricky to use, perhaps because it combines the complexity of Python with the complexity of C and the interactions between them.