#34755 closed Cleanup/optimization (wontfix)
Provide accelerated binary wheels
Reported by: | Stefan Behnel | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Normal | Keywords: | performance, cython, wheels |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
With Cython 3.0 released, it seems worth providing accelerated binary modules for important platforms that compile some Django modules with Cython in order to speed them up.
The idea is to take the Django package as it is, identify a couple of computationally intensive modules in it, compile them to binary extension modules with Cython, package the result as a binary wheel, and upload it to PyPI, next to the regular Python wheel, so that supported platforms can pick it up instead of the plain Python wheel. Note that this is completely optional since the binary wheels would behave just like the Python wheel, except for being faster.
Alex Orlov from Instagram tried this with the Django URL routing module back in 2017 and found a massive speedup, as he reported in his PyCon-US
2017 talk.
Even without any further manual optimisation, Cython compilation usually leads to a speedup of 10-30%, which translates to a substantial amount of time, energy and CO2-emissions saved on user side.
Change History (2)
comment:1 by , 16 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 16 months ago
There have been a couple of threads in the past about compiling with Cython, worth checking out: https://groups.google.com/g/django-developers/search?q=cython
I was involved in one effort compiling the templates module, it provided a benchmarked improvement but we couldn't spot it in our production graphs when deployed 🤷♂️.
Hello Stefan, thank you for your interest in making Django better!
There are many challenges related to this proposal that would need discussing with the community as a whole (considering Django is a community driven project). Specifically, the release process would considerably grow in complexity and that would require more resources/procedures/people/time.
For cases like this, the recommended path forward is to first propose and discuss the idea/request with the community and gain consensus. To do that, please start a new conversation on the Django Forum, where you'll reach a wider audience and likely get richer feedback.
I'll close the ticket following the triage guide, but if there is a community agreement for the proposal, you are welcomed to come back to the ticket and point to the forum topic, so we can then re-open it. For more details, please see the documented guidelines for requesting features.
Thanks!