pycraft
pycraft copied to clipboard
Cython optimizations
I was working on ways to speed up earlier versions of this project by way of Cython. When things stabilize a bit, I'll see about contributing some code in that vein, but if you don't want Cython to be a requirement, I can make it into a separately maintained fork.
How do you feel about CFFI? I'd prefer pypy compatibility for the server side, if it's reasonable to do that.
I haven't really worked with either.
The advantage of Cython is that it would allow us to selectively speed up hotspots in the code with relatively little work, by compiling those modules to C. CFFI is more about talking to existing C code. I don't think using Cython would preclude PyPy compatibility, though, but I'd have to check.
Well I'm not going to get in the way of any pull requests. I don't think there's any compelling reason to keep it in a separate fork.
Sure thing. I mention it only because it means the modules in question have to be essentially rewritten in Cython (it's a variant of Python with type hinting and some other changes), but we can try it out little by little and see how disruptive it is. Just compiling the code as-is yields only about a 15-20% improvement in performance; the really big gains require some rewriting.
It might also be possible to use the Cythonized version of a module if Cython is present in this particular installation, or fall back to the more general one if it's not.
I'm onboard for Cython - after things stabilize, of course. :+1: