4 ms·
> If your application's bottleneck is in parsing templates, either everything else is really fast or you have way too many complex templates. There are countle
by the_mitsuhiko 16y ago
> If your application's bottleneck is in parsing templates, either everything else is really fast or you have way too many complex templates.
There are countless of examples where the template engine is the bottleneck of an application. If you are doubting that, I welcome you to try it yourself. Benchmarking Django's templates and Genshi is an eye opening experience. :)
- m0th87 16y agoProof is in the pudding. Where's the pudding? :) From a quick google search, they seem pretty comparable. And in fact Django oftentimes wins. http://genshi.edgewall.org/wiki/GenshiPerformance http://genshi.edgewall.org/wiki/GenshiPerformance http://stackoverflow.com/questions/1324238/what-is-the-fastest-template-system-for-python http://stackoverflow.com/questions/1324238/what-is-the-faste...
- the_mitsuhiko 16y agoNever trust a benchmark you didn't run yourself. A realistic Genshi template is butt slow. More than a handful function calls per byte emitted is not uncommon. Regarding Django it become a lot slower when they introduced automatic escaping and loop item unpacking a while ago. I have seen many people switching from Django templates to Jinja2 especially because of the increased performance.
- thezilch 16y agoI believe Mitsuhiko was trying to draw comparisons of Django or Genshi engines to those of Jinja2 or Mako. There was a well depicted article, year(s) back, showing (profiling) where Django templating was losing a lot of work, compared to Jinja. Unfortunately, the article appears to have fallen off pocoo.org, but you can find the HN discussion at the following: http://news.ycombinator.com/item?id=726461 http://news.ycombinator.com/item?id=726461