-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate Cython support #56
Comments
Quick check shows that Cython can handle all of |
Packaging is a lot less straightforward. Basic template would be the Cython guide. Possible example projects are My main concern is that the package still has to work "out of the box". That means at least building wheels for all major platforms; separate GitHub Actions could help here. |
A simple approach to the packaging issue would be to provide a separate package for fast utilities. Similar to the stdlib, |
Major showstopper in my tests so far is that Cython's PyTypeObject does not (yet) define the |
Turns out the missing type fields are simple enough to define.
Got it working for a basic |
Experimental code is in a separate repo: https://github.com/maxfischer2781/asyncstdlib_cy |
I do have a clear roadmap on how this could be done, but it does not seem worth the effort at this point. There would have to be a separately maintained Cython codebase, yet the optimisations that Cython can perform statically on coroutines (especially the async-neutral ones) are minimal. If anyone needs a push of performance but cannot switch to PyPy, it looks like nuitka can compile the entire library for CPython. python -m nuitka --module asyncstdlib --include-package=asyncstdlib |
It looks like Cython is compatible with
asyncio
, python-trio/trio#550 and dabeaz/curio#326, as well as bulk of Python level functions (see cython/cython#2273). Sinceasyncstdlib
currently does some heavy lifting using pure Python, optimising this seems prudent.Rough checkpoints to using Cython:
async
asyncio
,trio
,curio
to ensure compatibilityThe text was updated successfully, but these errors were encountered: