Hacker News new | past | comments | ask | show | jobs | submit login
Optimizing Python with Cython (doublemap.github.io)
5 points by erjiang on May 29, 2015 | hide | past | favorite | 3 comments



If you can live with changing the signature from two tuples to just taking the four floats, you'll see a big further improvement --- these are the only lines showing up yellow when running the code through cython -a: https://rawgit.com/syllog1sm/a13542690c59d5e60ebf/raw/499418...


Looking at this step:

-from math import sin, cos, acos

+from libc.math cimport sin, cos, acos

What happens if the C math functions and the Python math functions don't take the same arguments/kinds of arguments?


On my system, PyPy is 4x faster than the fastest Cython version given.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: