falcon icon indicating copy to clipboard operation
falcon copied to clipboard

Decorate source with Cython extensions where it helps

Open kgriffs opened this issue 13 years ago • 4 comments

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

kgriffs avatar Apr 26 '13 18:04 kgriffs

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%.

queertypes avatar Sep 11 '13 18:09 queertypes

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. 😄

kgriffs avatar Apr 26 '16 14:04 kgriffs

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

kgriffs avatar Apr 26 '16 14:04 kgriffs

We have implemented some critical code paths in Cython (for CPython) since, more to come.

vytas7 avatar Nov 22 '22 08:11 vytas7