[Django] #21109: Performance regression due to wrap_database_errors

13 views
Skip to first unread message

Django

unread,
Sep 17, 2013, 5:06:46 AM9/17/13
to django-...@googlegroups.com
#21109: Performance regression due to wrap_database_errors
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.6-beta-1
Component: Database | Keywords:
layer (models, ORM) | Has patch: 1
Severity: Normal | Needs tests: 0
Triage Stage: Ready for | Easy pickings: 0
checkin |
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Djangobench comparison between 1.5.x and 1.6.x revealed a problem with
database error wrapping. Somewhat surprisingly the reason for the
regression is functools.wraps. In addition it is possible to use
@cached_property for connection.wrap_database_errors.

The regression was around 10% for query_iterator and around 50% for
raw_sql djangobench benchmarks.

A patch is available from
https://github.com/akaariai/django/commit/eafc373c16350abe51c565c8aefbe36cabf5219e.
There is a minor comment fix to be done, otherwise ready for checkin.

Discussion about performance of 1.5.x vs 1.6.x:
https://groups.google.com/forum/#!topic/django-developers/ytr3j8suVxE

--
Ticket URL: <https://code.djangoproject.com/ticket/21109>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 17, 2013, 5:23:47 AM9/17/13
to django-...@googlegroups.com
#21109: Performance regression due to wrap_database_errors
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version:
Component: Database layer | 1.6-beta-1
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anssi Kääriäinen <akaariai@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"94001421321bd8808c4027a72aa32a1eef005764"]:
{{{
#!CommitTicketReference repository=""
revision="94001421321bd8808c4027a72aa32a1eef005764"
Fixed #21109 -- made db cursor error wrapping faster
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21109#comment:1>

Django

unread,
Sep 17, 2013, 5:31:43 AM9/17/13
to django-...@googlegroups.com
#21109: Performance regression due to wrap_database_errors
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version:
Component: Database layer | 1.6-beta-1
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Anssi Kääriäinen <akaariai@…>):

In [changeset:"5937f291c1dd74b40ab14be7b8a8112ff91ac08e"]:
{{{
#!CommitTicketReference repository=""
revision="5937f291c1dd74b40ab14be7b8a8112ff91ac08e"
[1.6.x] Fixed #21109 -- made db cursor error wrapping faster

Backpatch of 94001421321bd8808c4027a72aa32a1eef005764 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21109#comment:2>

Reply all
Reply to author
Forward
0 new messages