#35102: Performance regression on Model.objects.count() between Django 4.2 and
5.0
-------------------------------------+-------------------------------------
Reporter: Anthony Shaw | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Anthony Shaw):
Replying to [comment:10 Simon Charette]:
> I think we can get a lot of benefit by ''caching'' `inspect.signature`
calls like the following.
That patch alone is 1.4x faster
{{{
djangobench --control main --experiment exp_1 query_count -t 200
Running benchmarks: query_count
Control: Django 5.1 (in git branch main)
Experiment: Django 5.1 (in git branch exp_1)
Running 'query_count' benchmark ...
Min: 0.000266 -> 0.000186: 1.4310x faster
Avg: 0.000292 -> 0.000202: 1.4424x faster
Significant (t=23.676856)
Stddev: 0.00004 -> 0.00003: 1.4418x smaller (N = 200)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35102#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018cfa2b58c3-adf860f9-33c2-4803-9960-2651ccd2a2bd-000000%40eu-central-1.amazonses.com.