Opened 3 weeks ago

Last modified 2 weeks ago

#36983 new Cleanup/optimization

Improve free-threading performance

Reported by: Sam Gross Owned by:
Component: Core (Other) Version: 6.0
Severity: Normal Keywords:
Cc: Sam Gross, Simon Charette Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I’m a CPython core developer working on free-threading. Would the Django team be interested in reviewing patches aimed at improving Django's performance on free-threaded Python (e.g., 3.14t)?

For example, there are a few scaling bottlenecks caused by creating temporary Field instances, such as in rel_db_type(). This can lead to contention on the shared creation_counter and also invalidate CPython’s attribute lookup cache. I expect most of the patches to be fairly small.

For context, I’m using Zulip to identify and investigate these issues, and I’m also working to fix the underlying problems in CPython upstream where possible.

Change History (4)

comment:1 by Natalia Bidart, 3 weeks ago

Component: UncategorizedCore (Other)

Hello Sam! Thank you for the ticket and for the suggestion to improve Django's performance on free-threaded Python.

I think this is a generous offer, and that Django would benefit from this work. Since Django is a community-driven project, the best place to discuss this proposal is on the Django Forum. Please consider opening a topic in the “Django Internals” category outlining your proposal. It would also be very helpful if you could share some details about the issues you have identified so far.

I'll make sure to subscribe to the forum post and monitor the replies. Once there is discussion and community interest on the forum, we can reopen and accept the ticket if there is clear agreement to proceed.

comment:3 by Simon Charette, 3 weeks ago

Cc: Simon Charette added

comment:4 by Jacob Walls, 2 weeks ago

Triage Stage: UnreviewedSomeday/Maybe

I agree with Natalia that Django will benefit from this work. Reception was positive on the forum. Adjusting the triage state to reflect the "long-term changes" aimed at here.

Note: See TracTickets for help on using tickets.
Back to Top