Opened 12 years ago
Closed 12 years ago
#19276 closed Cleanup/optimization (fixed)
ORM performance regression between 1.4.x and 1.5.x
Reported by: | Anssi Kääriäinen | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.5-alpha-1 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I did some benchmarking for performance regressions between 1.4 and 1.5 (using Python 2.6.7 and djangobench). I found that nearly every ORM benchmark for djangobench has regressed about 10%. I made a time series of one benchmark (query_annotate), available here: http://users.tkk.fi/~akaariai/djbench/query_annotate.html
There are two commits which show up in the graph:
- Minor regession for: 4a103086d5c67fa4fcc53c106c9fdf644c742dd8 (unicode literals for py3)
- A bit larger regression for: ab6cd1c839b136cbc94178da433b2e97ab7f6061 (updated dict like datastructs for py3)
It seems there is some low-hanging fruit especially for the second commit, see here: https://github.com/akaariai/django/compare/orm_perf
Change History (7)
comment:1 by , 12 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I did a little more work, and now I have RFC stuff in https://github.com/akaariai/django/compare/ticket_19276
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
OK, it seems the regressions are now fixed, see: http://users.tkk.fi/~akaariai/djbench/query_select_related/ and http://users.tkk.fi/~akaariai/djbench/query_annotate/ (the last commits are barely visible in the right, but they are there...).
One more regression spotted - query_select_related got hit by the above regressions + another change made for fixing Oracle in select_related cases. Commit: c159d9cec0baab7bbd04d5d51a92a51e354a722a, graph here: http://users.tkk.fi/~akaariai/djbench/query_select_related/
A patch for the select_related case is available here: https://github.com/akaariai/django/compare/fix_select_related_perf (the reason for the regression was the repeated access to connections[using], the fix dodges this and makes the code a little cleaner, too).
I am elevating this to release blocker. While the regressions aren't really that severe, it is a good idea to check if we can easily fix the performance regressions before the final release. If not, then lets just close this ticket. So, release blocker as in "lets not forget to check this before release".