From 5dfbfc1e75ffe476b80a3de65b71bfb2ba8e753b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 25 May 2008 18:10:12 +0200 Subject: [PATCH] updated FAQ for performance numbers. I guess I should remove that point anyways. --HG-- branch : trunk --- docs/faq.rst | 4 ++-- jinja2/environment.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index dc75f98..3a04c20 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -18,8 +18,8 @@ How fast is it? We really hate benchmarks especially since they don't reflect much. The performance of a template depends on many factors and you would have to benchmark different engines in different situations. The benchmarks from the -testsuite show that Jinja2 has a similar performance to `Mako`_ and is more -than 20 times faster than Django's template engine or Genshi. These numbers +testsuite show that Jinja2 has a similar performance to `Mako`_ and is between +10 and 20 times faster than Django's template engine or Genshi. These numbers should be taken with tons of salt as the benchmarks that took these numbers only test a few performance related situations such as looping. They are not a good indicator for the templates used in the average application. diff --git a/jinja2/environment.py b/jinja2/environment.py index 5ec8cb5..dc8bc25 100644 --- a/jinja2/environment.py +++ b/jinja2/environment.py @@ -654,11 +654,10 @@ class TemplateStream(object): if size <= 1: raise ValueError('buffer size too small') - def generator(): + def generator(next): buf = [] c_size = 0 push = buf.append - next = self._gen.next while 1: try: @@ -675,7 +674,7 @@ class TemplateStream(object): c_size = 0 self.buffered = True - self._next = generator().next + self._next = generator(self._gen.next).next def __iter__(self): return self -- 2.26.2