Skip to content
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

Embracing Cython 3.0 pure python mode to speed-up the library #283

Open
msaelices opened this issue Sep 20, 2023 · 2 comments
Open

Embracing Cython 3.0 pure python mode to speed-up the library #283

msaelices opened this issue Sep 20, 2023 · 2 comments

Comments

@msaelices
Copy link

Recently, Cython released the 3.0 version with a Pure Python mode, and I think it would be a game changer in this library, as most of the code is just Python logic using basic types.

Having all the parsing and validation logic running at C speed would be awesome.

The only downside is the library would need to drop support for Python 2, but: is this really a piece of bad news?

I could help with the optimization.

@daviddrysdale
Copy link
Owner

Does supporting Cython just involve maintaining parallel .pxd files, similar to the .pyi files that already have parallel type information?

Also, why would Cython support require removal of Python 2 support?

@AA-Turner
Copy link
Contributor

There's also mypyc, which uses type hints to compile to C.

maintaining parallel .pxd files

It seems like Cython would work even absent the .pxd files, but adding them increases the information provided to Cython and hence the speed-up is greater.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants