4 ms·
When I was taking a python class in school, the professor did something to generate C code from the Python code, and it gave something like a 60% speedup.
by knicholes 9y ago
When I was taking a python class in school, the professor did something to generate C code from the Python code, and it gave something like a 60% speedup.
- repsilat 9y agoProbably Cython. Sometimes it helps, sometimes it doesn't work (doesn't like generator comprehensions iirc) but mostly it provides a "sliding scale" into C or C++ land -- after the first compile, you can start littering type declarations around the code and you can stop whenever you hit the speed you want. It has been a good solution for me in the past, but probably only because I started with a Python codebase. If I were starting afresh I wouldn't bother.