Opened 18 years ago

Closed 18 years ago

#3067 closed defect (fixed)

[patch] Caching of servername in mail.py slows down startup time

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Core (Mail) Version:
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

Especially when running the development server! Every time code changes it can take up to a couple of seconds to restart (before the patch in #3007 it was noticeably faster).

I wrote the initial change to cache the dns name, and while that's still a good idea it would be better to do it lazily instead. Patch attached.

Attachments (1)

better_servername_caching.patch (753 bytes ) - added by Chris Beaven 18 years ago.

Download all attachments as: .zip

Change History (5)

by Chris Beaven, 18 years ago

comment:1 by Adrian Holovaty, 18 years ago

Component: Core frameworkdjango.core.mail

comment:2 by Chris Beaven, 18 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by Malcolm Tredinnick, 18 years ago

It's more normal Python practice to use __str__ for "transparent output" classes like this, so that __repr__ can still be used in debugging, etc, to display the real object (the class instance). I've made that change in the patch I've applied to the repository.

comment:4 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

(In [4536]) Fixed #3067 -- Improved caching of machine hostname to increase server restart
times. Thanks SmileyChris.

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