Opened 22 months ago

Closed 22 months ago

Last modified 22 months ago

#21109 closed Cleanup/optimization (fixed)

Performance regression due to wrap_database_errors

Reported by: akaariai Owned by: nobody
Component: Database layer (models, ORM) Version: 1.6-beta-1
Severity: Normal 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

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

Change History (2)

comment:1 Changed 22 months ago by Anssi Kääriäinen <akaariai@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 94001421321bd8808c4027a72aa32a1eef005764:

Fixed #21109 -- made db cursor error wrapping faster

comment:2 Changed 22 months ago by Anssi Kääriäinen <akaariai@…>

In 5937f291c1dd74b40ab14be7b8a8112ff91ac08e:

[1.6.x] Fixed #21109 -- made db cursor error wrapping faster

Backpatch of 94001421321bd8808c4027a72aa32a1eef005764 from master.

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