[Django] #36983: Improve free-threading performance

4 views
Skip to first unread message

Django

unread,
Mar 12, 2026, 11:31:47 AM (6 days ago) Mar 12
to django-...@googlegroups.com
#36983: Improve free-threading performance
-------------------------------------+-------------------------------------
Reporter: Sam Gross | Type:
| Cleanup/optimization
Status: new | Component:
| Uncategorized
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/36983>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 12, 2026, 2:03:48 PM (6 days ago) Mar 12
to django-...@googlegroups.com
#36983: Improve free-threading performance
-------------------------------------+-------------------------------------
Reporter: Sam Gross | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* component: Uncategorized => Core (Other)

Comment:

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
[https://forum.djangoproject.com/c/internals/5 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/36983#comment:1>

Django

unread,
Mar 12, 2026, 4:07:46 PM (6 days ago) Mar 12
to django-...@googlegroups.com
#36983: Improve free-threading performance
-------------------------------------+-------------------------------------
Reporter: Sam Gross | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sam Gross):

Thank you Natalia! I posted here: https://forum.djangoproject.com/t
/improve-free-threading-performance/44497
--
Ticket URL: <https://code.djangoproject.com/ticket/36983#comment:2>

Django

unread,
Mar 12, 2026, 4:51:33 PM (6 days ago) Mar 12
to django-...@googlegroups.com
#36983: Improve free-threading performance
-------------------------------------+-------------------------------------
Reporter: Sam Gross | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* cc: Simon Charette (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36983#comment:3>

Django

unread,
1:35 PM (6 hours ago) 1:35 PM
to django-...@googlegroups.com
#36983: Improve free-threading performance
-------------------------------------+-------------------------------------
Reporter: Sam Gross | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Someday/Maybe

Comment:

I agree with Natalia that Django will benefit from this work. Reception
was positive on the forum. Adjusting the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#someday-maybe triage state] to reflect the "long-term changes"
aimed at here.
--
Ticket URL: <https://code.djangoproject.com/ticket/36983#comment:4>
Reply all
Reply to author
Forward
0 new messages