Dear Django folks,just an information that I would like to share (and be happy to hear some feedback):
The users of my mod_wsgi hosted app reported bad performance in a large view that consists of a table of hundreds of rows and dozens of columns.
I first used the Django Debug Toolbar to find database/query bottlenecks and issues, when these where down to few accesses and few milliseconds, made sure that my server was indeed CPU-limited (what I was somewhat surprised to find), and finally I used repoze.profile [1] [2] for performance profiling.
Even with the django.template.loaders.cached.Loader enabled, it turned out that by far most of the time was spent in render_to_response(), and there especially in i18n and l10n related methods.
I almost settled with banning all {% load i18n %} statements from my non-admin templates, when by accident I found that in fact USE_L10N = True in settings.py was the true source of the low performance (quite contrary to the answer provided in [3])!
That is, setting USE_L10N = False more than doubled the performance of my script and removed all i18n/l10n related traces from the top of the profiler stats! (And left me with numbers like 7.5 rather than 7,5, but that's not really a serious problem here.)
In summary, contrary to [3], I hope that the docs keep or add thick, fat and blinking warnings about the performance impacts of USE_L10N ;-)
Best regards, Carsten [1] <http://docs.repoze.org/profile/>[2] <http://www.eflorenzano.com/blog/post/wsgi-middlware-awesome-django-use-it-more/> [3] <http://stackoverflow.com/questions/1121873/django-internationalization-and-localization-performance-difference>
-- Cafu - the open-source Game and Graphics Engine for multiplayer, cross-platform, real-time 3D Action Learn more at http://www.cafu.de
smime.p7s
Description: S/MIME Cryptographic Signature