Skip to content
Myr

updated FAQ for performance numbers. I guess I should remove that point anyways.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent f3d6a73 · Browse files · 2 files+4 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−5 removed

  • other:+4 added−5 removed

2 files+4 added−5 removed

modified:docs/faq.rst+2 added-2 removed
16 unmodified lines
1718We really hate benchmarks especially since they don't reflect much. The19performance of a template depends on many factors and you would have to20benchmark different engines in different situations. The benchmarks from the21testsuite show that Jinja2 has a similar performance to `Mako`_ and is more22than 20 times faster than Django's template engine or Genshi. These numbers21testsuite show that Jinja2 has a similar performance to `Mako`_ and is between2210 and 20 times faster than Django's template engine or Genshi. These numbers23should be taken with tons of salt as the benchmarks that took these numbers24only test a few performance related situations such as looping. They are25not a good indicator for the templates used in the average application.26Additionally you should keep in mind that for most web applications
121 unmodified lines
modified:jinja2/environment.py+2 added-3 removed
652 unmodified lines
653 """Enable buffering. Buffer `size` items before yielding them."""654 if size <= 1:655 raise ValueError('buffer size too small')656657 def generator():657 def generator(next):658 buf = []659 c_size = 0660 push = buf.append661 next = self._gen.next661662 while 1:663 try:664 while c_size < size:
8 unmodified lines
673 del buf[:]674 c_size = 0675676 self.buffered = True678 self._next = generator().next677 self._next = generator(self._gen.next).next678679 def __iter__(self):680 return self681
7 unmodified lines