Dear Karen,

Am 25.03.2011 01:18, schrieb Karen Tracey:
First, do you really mean USE_I18N everywhere where you have USE_L10N?

The top cumtime item:

    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     18333    0.706    0.000    4.368    0.000
/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py:23(delayed_loader)

is one whose execution time will be vastly different depending on
USE_I18N value. I cannot figure out why it would be getting called more
(or be more expensive to call) with USE_L10N = True vs. False, so I'm
thinking you must have changed USE_I18N to see the dramatic performance
difference?

During my first performance profilings, when I saw "translation" and "gettext" mentioned frequently in the profile stats, so my first reaction was indeed to switch USE_I18N off, but then I found that my performance only improved mildly and by a constant amount, and that I still had very many number-format related lines in the profile stats.

Then I switched USE_I18N on again (also because my admin-users need German language texts in the admin interface), and tried USE_L10N = False, and was surprised by the significantly faster code as described in my initial posts in this thread.

In summary, my previous post with the profile stats and my referring to the effect of USE_L10N (and not USE_I18N, which I kept on all the time) was correct.

(I also did all measurements several times (skipping the first page loads when the code was re-initialized), and reproducing this was reliable possible every time.)

(There are already notes in the doc that if you don't need
translation you should turn USE_I18N off, see:
http://docs.djangoproject.com/en/1.3/topics/i18n/deployment/#if-you-don-t-need-internationalization,
http://docs.djangoproject.com/en/1.3/ref/settings/#use-i18n.)

Thanks!  ;-)

Second, have you tried running with 1.3? That top call listed in the
first report no longer exists, it was removed by the fix to this ticket:
http://code.djangoproject.com/ticket/14306, motivation being performance
improvement. So it would be interesting to see how your results compare
with the current release.

Ah, thanks for pointing #14306 out, I wasn't aware of this change.

It will take me another few days until I'm ready to upgrade to 1.3, but as soon as I've done that I'll profile again and report my findings.

Many thanks for your help,
and best regards,
Carsten



--
   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
          Learn more at http://www.cafu.de

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to