--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c16befb5-c12d-43cc-84a2-6931c245b8a5%40googlegroups.com.
After a while I believe layers and layers of caution have accrued, and nobody is sure any more where these have overlapped excessively.
Django: 9.08e-05
Jinja2: 1.38e-05
The big difference here is because Django uses a recursive node-based renderer, whereas Jinja2 just translates the template into Python. That means a lot less overhead when rendering happens.
Optimizing Django rendering means either:
1) Identifying the nodes which are a bottleneck and reducing the work they do
2) Replacing node rendering with something that's faster.
Option 2 probably has the biggest opportunity for gain, but it would require some real creativity to maintain backwards-compatibility with existing tags.
Preston
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/957b9840-b537-4861-9390-e7b6f44dd72c%40googlegroups.com.
I've done a couple of days of investigation into template performance recently trying to speed up our site and my main takeaway was that there was no silver bullet - no particular node taking up all of the time. I was mostly trying to optimise a particularly complicated template we render a lot in a loop so I was modifying the template, Django code and making custom tags to see what would make a difference rather than trying to decipher profiles. We use the cached template loader so compile time wasn't really considered.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1b2d01a2-7660-42e5-a860-5781ad13b264%40googlegroups.com.
The test template we were using to test the performance was a simple:{% for item in item_list %}{% include "item.html" %}{% endfor %}
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANE-7mXhB%2BgUNt_vZpvmMwBFfu1wYDBHaMWh1kx-HKg1%3DFcUGA%40mail.gmail.com.
Hi,
I've run this benchmark (https://github.com/prestontimmons/templatebench) on my laptop and received following results – http://pastebin.com/kkyTcfi7.
From what I see, internal caching mainly solves a problem with parsing. However, rendering is still an issue, so I tried to figure out what slows rendering down. In order to do that I've built built a call graph for rendering a template with many includes (source - http://pastebin.com/jjF1kME8). Resulting graph is attached. From this graph I see that significant part of rendering is devoted to building templates, not rendering them (calls to django.template.engine.Engine.get_template).
So here goes the question. Does it suppose to behave like that? And why it happens?
Thanks,
Oleksii