Hacker News new | comments | show | ask | jobs | submit login
Optimizing Python with Cython (doublemap.github.io)
5 points by erjiang 730 days ago | hide | past | web | 3 comments | favorite



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.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: