> Stupidly, I had left the 'HOST' line out of the above configuration,
> causing both 'default' and 'other' to point to 'localhost'. Once this
> was rectified, the test times seem a lot more reasonable. So it was
> nothing to do with runtime overheads like calling u() etc.

I did a little performance test, testing a simple template rendering:
"""
        t = Template("{% for o in objs %}{% if o %}<li>{{o}}</li>{%
endif %}{% endfor %}")
        c = Context({'objs': [u('foo') if i % 2 == 0 else u('') for i
in range(0, 1000)]})
        from datetime import datetime
        start = datetime.now()
        for i in range(0, 100):
            t.render(c)
        print(datetime.now() - start)
"""

Both with and without the u('foo') in there (and of course replacing
u('foo') with u'foo' for Django trunk. Note that the u() doesn't have
any direct effect, but will cause extra effort for Python 2 due to the
need to do unicode conversion:
Python 3.2, Vinay's branch, with u: 6.884, 6.919, 7.074
Python 3.2, Vinay's branch, without u: 6.877, 6.847, 6.976
Python 2.6, Vinay's branch, with u: 8.328, 8.291, 8.271
Python 2.6, Vinay's branch, without u: 8.786, 8.937, 8.935

In this test PyPy runs in around 2 seconds, and in around 1 second if
you give it a warm-up run.

For Django-trunk, Python 2.6, with u: 7.775, 7.881, 7.918
Django-trunk, Python 2.6, without u: 8.417, 8.612, 8.411

It seems there is some slight slowdown when using Python 2.6. This is
matched by a little more speedup when using Python 3.2.

It would be informative to check also queryset creation & iteration,
which can be a major performance problem in some use cases.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to