Decorate source with Cython extensions where it helps
Considerations:
- If we do this, will it break PyPy?
- Can we use some kind of pre-processor step to add extensions so we can keep a pure python version around?
See also: http://nbviewer.ipython.org/6245c96743db51020c3b
Seems like it makes more sense to extract out the more expensive portions to C and use cffi - in the interest of keeping pypy compatibility 100%.
The trick with cffi is that thunking across to C can offset any potential gains in performance. It would only be useful for chunks of code that consume relatively large amounts of CPU time.
Regardless, there may be an argument for just saying "use pypy" if you want things to go faster overall. 😄
P.S. - Cython's "pure python mode" may allow us to implement some optimizations while retaining pypy compat. See also: http://docs.cython.org/src/tutorial/pure.html
We have implemented some critical code paths in Cython (for CPython) since, more to come.