Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias identifier ImportFrom alias identifier Assign NameStore Dict Str Str Str ListComp Call NameLoad keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num comprehension NameStore Call NameLoad Num Assign NameStore Call NameLoad Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call AttributeLoad Call NameLoad keyword Str keyword Str keyword Str attr Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list TryExcept body ImportFrom alias Expr Call AttributeLoad NameLoad attr ImportFrom alias identifier alias identifier handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str FunctionDef arguments args defaults body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str ListLoad TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list TryExcept body ImportFrom alias identifier handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list TryExcept body ImportFrom alias identifier handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str FunctionDef arguments args defaults body Expr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Str keyword NameLoad decorator_list TryExcept body ImportFrom alias identifier handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str keyword ListLoad Call NameLoad NameLoad FunctionDef arguments args defaults body Expr Call NameLoad NameLoad decorator_list TryExcept body Import alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str FunctionDef arguments args defaults body ImportFrom alias alias Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad decorator_list TryExcept body ImportFrom alias identifier ImportFrom alias identifier handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad Dict Str NameLoad Assign NameStore Call NameLoad NameLoad Dict Str NameLoad FunctionDef arguments args defaults body Expr Call AttributeLoad Call NameLoad keyword ListLoad NameLoad attr decorator_list TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str ListLoad TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list TryExcept body ImportFrom alias ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str keyword Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str ListLoad TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str Call AttributeLoad Str attr TupleLoad BinOpMult Str Num Call AttributeLoad Str attr Num BinOpMult Str Num Str BinOpMult Str Num Str For NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str body If CompareIs SubscriptLoad Call NameLoad Index BinOpAdd Str NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad Continue Assign NameStore Call NameLoad keyword BinOpMod Str NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad NameLoad BinOpDiv Call AttributeLoad NameLoad attr keyword Num Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpMult Str Num Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str BinOpMult Str Num Str
N/A N/A     This benchmark compares some python templating engines with Jinja 2 so
    that we get a picture of how fast Jinja 2 is for a semi real world
    template.  If a template engine is not installed the test is skipped.
    Benchmark example from Jinja2, add Lunar template test.

    A sample out base on my pc machine.

    Linux Platform:
    ----------------------------------
    jinja               0.0052 seconds
    mako                0.0052 seconds
    tornado             0.0200 seconds
    django              0.2643 seconds
    genshi              0.1306 seconds
    lunar               0.0301 seconds
    cheetah             0.0256 seconds
    ----------------------------------

    Windows Platform:
    ----------------------------------
    ----------------------------------

    jinja               0.0216 seconds
    mako                0.0206 seconds
    tornado             0.0286 seconds
    lunar               0.0420 seconds
    cheetah             0.1043 seconds
    -----------------------------------
 N/A sys N/A cgi timeit Timer jinja2 Environment JinjaEnvironment lunar.template Template LunarTemplate N/A context N/A page_title table mitsuhiko's benchmark N/A N/A dict a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10 N/A x N/A range 1000 N/A lunar_template N/A LunarTemplate 
<!doctype html>
<html>
  <head>
    <title>{{ page_title }}</title>
  </head>
  <body>
    <div class="header">
      <h1>{{ page_title }}</h1>
    </div>
    <ul class="navigation">
    {% for href, caption in [         ('index.html', 'Index'),         ('downloads.html', 'Downloads'),         ('products.html', 'Products')       ] %}
      <li><a href="{{ href }}">{{ caption }}</a></li>
    {% endfor %}
    </ul>
    <div class="table">
      <table>
      {% for row in table %}
        <tr>
        {% for cell in row %}
          <td>{{ cell }}</td>
        {% endfor %}
        </tr>
      {% endfor %}
      </table>
    </div>
  </body>
</html> test_lunar N/A N/A N/A N/A N/A N/A N/A lunar_template render context N/A N/A jinja_template N/A N/A N/A JinjaEnvironment line_statement_prefix % variable_start_string ${ variable_end_string } from_string <!doctype html>
<html>
  <head>
    <title>${page_title|e}</title>
  </head>
  <body>
    <div class="header">
      <h1>${page_title|e}</h1>
    </div>
    <ul class="navigation">
    % for href, caption in [
        ('index.html', 'Index'),
        ('downloads.html', 'Downloads'),
        ('products.html', 'Products')
      ]
      <li><a href="${href|e}">${caption|e}</a></li>
    % endfor
    </ul>
    <div class="table">
      <table>
      % for row in table
        <tr>
        % for cell in row
          <td>${cell}</td>
        % endfor
        </tr>
      % endfor
      </table>
    </div>
  </body>
</html> test_jinja N/A N/A N/A N/A N/A N/A N/A jinja_template render context N/A N/A N/A tornado.template Template N/A N/A N/A ImportError N/A N/A test_tornado None N/A N/A tornado_template N/A Template <!doctype html>
<html>
  <head>
    <title>{{ page_title }}</title>
  </head>
  <body>
    <div class="header">
      <h1>{{ page_title }}</h1>
    </div>
    <ul class="navigation">
    {% for href, caption in [         ('index.html', 'Index'),         ('downloads.html', 'Downloads'),         ('products.html', 'Products')       ] %}
      <li><a href="{{ href }}">{{ caption }}</a></li>
    {% end %}
    </ul>
    <div class="table">
      <table>
      {% for row in table %}
        <tr>
        {% for cell in row %}
          <td>{{ cell }}</td>
        {% end %}
        </tr>
      {% end %}
      </table>
    </div>
  </body>
</html> test_tornado N/A N/A N/A N/A N/A N/A N/A tornado_template generate context N/A N/A N/A django.conf settings N/A N/A N/A settings configure django.template Template DjangoTemplate Context DjangoContext N/A N/A N/A ImportError N/A N/A test_django None N/A N/A django_template N/A DjangoTemplate <!doctype html>
<html>
  <head>
    <title>{{ page_title }}</title>
  </head>
  <body>
    <div class="header">
      <h1>{{ page_title }}</h1>
    </div>
    <ul class="navigation">
    {% for href, caption in navigation %}
      <li><a href="{{ href }}">{{ caption }}</a></li>
    {% endfor %}
    </ul>
    <div class="table">
      <table>
      {% for row in table %}
        <tr>
        {% for cell in row %}
          <td>{{ cell }}</td>
        {% endfor %}
        </tr>
      {% endfor %}
      </table>
    </div>
  </body>
</html> test_django N/A N/A N/A N/A N/A c N/A DjangoContext context N/A N/A c N/A navigation N/A N/A index.html Index N/A downloads.html Downloads N/A products.html Products N/A N/A N/A django_template render c N/A N/A N/A mako.template Template MakoTemplate N/A N/A N/A ImportError N/A N/A test_mako None N/A N/A mako_template N/A MakoTemplate <!doctype html>
<html>
  <head>
    <title>${page_title|h}</title>
  </head>
  <body>
    <div class="header">
      <h1>${page_title|h}</h1>
    </div>
    <ul class="navigation">
    % for href, caption in [('index.html', 'Index'), ('downloads.html', 'Downloads'), ('products.html', 'Products')]:
      <li><a href="${href|h}">${caption|h}</a></li>
    % endfor
    </ul>
    <div class="table">
      <table>
      % for row in table:
        <tr>
        % for cell in row:
          <td>${cell}</td>
        % endfor
        </tr>
      % endfor
      </table>
    </div>
  </body>
</html> test_mako N/A N/A N/A N/A N/A N/A N/A mako_template render context N/A N/A N/A genshi.template MarkupTemplate GenshiTemplate N/A N/A N/A ImportError N/A N/A test_genshi None N/A N/A genshi_template N/A GenshiTemplate <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/">
  <head>
    <title>${page_title}</title>
  </head>
  <body>
    <div class="header">
      <h1>${page_title}</h1>
    </div>
    <ul class="navigation">
      <li py:for="href, caption in [
        ('index.html', 'Index'),
        ('downloads.html', 'Downloads'),
        ('products.html', 'Products')]"><a href="${href}">${caption}</a></li>
    </ul>
    <div class="table">
      <table>
        <tr py:for="row in table">
          <td py:for="cell in row">${cell}</td>
        </tr>
      </table>
    </div>
  </body>
</html> test_genshi N/A N/A N/A N/A N/A N/A N/A N/A N/A genshi_template generate context render html strip_whitespace False N/A N/A N/A Cheetah.Template Template CheetahTemplate N/A N/A N/A ImportError N/A N/A test_cheetah None N/A N/A cheetah_template N/A CheetahTemplate #import cgi
<!doctype html>
<html>
  <head>
    <title>$cgi.escape($page_title)</title>
  </head>
  <body>
    <div class="header">
      <h1>$cgi.escape($page_title)</h1>
    </div>
    <ul class="navigation">
    #for $href, $caption in [('index.html', 'Index'), ('downloads.html', 'Downloads'), ('products.html', 'Products')]:
      <li><a href="$cgi.escape($href)">$cgi.escape($caption)</a></li>
    #end for
    </ul>
    <div class="table">
      <table>
      #for $row in $table:
        <tr>
        #for $cell in $row:
          <td>$cell</td>
        #end for
        </tr>
      #end for
      </table>
    </div>
  </body>
</html> searchList N/A N/A dict context test_cheetah N/A N/A N/A N/A N/A N/A unicode cheetah_template N/A N/A N/A N/A tenjin N/A N/A N/A ImportError N/A N/A test_tenjin None N/A N/A tenjin_template N/A N/A tenjin Template N/A N/A N/A tenjin_template convert <!doctype html>
<html>
  <head>
    <title>${page_title}</title>
  </head>
  <body>
    <div class="header">
      <h1>${page_title}</h1>
    </div>
    <ul class="navigation">
<?py for href, caption in [('index.html', 'Index'), ('downloads.html', 'Downloads'), ('products.html', 'Products')]: ?>
      <li><a href="${href}">${caption}</a></li>
<?py #end ?>
    </ul>
    <div class="table">
      <table>
<?py for row in table: ?>
        <tr>
<?py     for cell in row: ?>
          <td>#{cell}</td>
<?py #end ?>
        </tr>
<?py #end ?>
      </table>
    </div>
  </body>
</html> test_tenjin N/A N/A N/A N/A tenjin.helpers escape to_str N/A N/A N/A tenjin_template render context N/A locals N/A N/A N/A spitfire.compiler util SpitfireTemplate spitfire.compiler.analyzer o2_options spitfire_optimizer N/A N/A N/A ImportError N/A N/A test_spitfire None N/A N/A spitfire_template N/A N/A SpitfireTemplate load_template <!doctype html>
<html>
  <head>
    <title>$cgi.escape($page_title)</title>
  </head>
  <body>
    <div class="header">
      <h1>$cgi.escape($page_title)</h1>
    </div>
    <ul class="navigation">
    #for $href, $caption in [('index.html', 'Index'), ('downloads.html', 'Downloads'), ('products.html', 'Products')]
      <li><a href="$cgi.escape($href)">$cgi.escape($caption)</a></li>
    #end for
    </ul>
    <div class="table">
      <table>
      #for $row in $table
        <tr>
        #for $cell in $row
          <td>$cell</td>
        #end for
        </tr>
      #end for
      </table>
    </div>
  </body>
</html> spitfire_tmpl spitfire_optimizer N/A enable_filters False N/A spitfire_context N/A dict context N/A cgi cgi test_spitfire N/A N/A N/A N/A N/A N/A N/A N/A spitfire_template search_list N/A spitfire_context main N/A N/A N/A chameleon.zpt.template PageTemplate N/A N/A N/A ImportError N/A N/A test_chameleon None N/A N/A chameleon_template N/A PageTemplate <html xmlns:tal="http://xml.zope.org/namespaces/tal">
  <head>
    <title tal:content="page_title">Page Title</title>
  </head>
  <body>
    <div class="header">
      <h1 tal:content="page_title">Page Title</h1>
    </div>
    <ul class="navigation">
    <li tal:repeat="item sections"><a tal:attributes="href item[0]" tal:content="item[1]">caption</a></li>
    </ul>
    <div class="table">
      <table>
        <tr tal:repeat="row table">
        <td tal:repeat="cell row" tal:content="row[cell]">cell</td>
        </tr>
      </table>
    </div>
  </body>
</html> N/A chameleon_context N/A dict context N/A N/A chameleon_context N/A sections N/A N/A index.html Index N/A downloads.html Downloads N/A products.html Products test_chameleon N/A N/A N/A N/A N/A N/A N/A chameleon_template render chameleon_context N/A N/A N/A chameleon.zpt.template PageTemplate chameleon.genshi language N/A N/A N/A ImportError N/A N/A test_chameleon_genshi None N/A N/A chameleon_genshi_template N/A PageTemplate <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/">
  <head>
    <title>${page_title}</title>
  </head>
  <body>
    <div class="header">
      <h1>${page_title}</h1>
    </div>
    <ul class="navigation">
    <li py:for="info in sections"><a href="${info[0]}">${info[1]}</a></li>
    </ul>
    <div class="table">
      <table>
        <tr py:for="row in table">
          <td py:for="cell in row">${row[cell]}</td>
        </tr>
      </table>
    </div>
  </body>
</html> parser N/A N/A language Parser N/A chameleon_genshi_context N/A dict context N/A N/A chameleon_genshi_context N/A sections N/A N/A index.html Index N/A downloads.html Downloads N/A products.html Products test_chameleon_genshi N/A N/A N/A N/A N/A N/A N/A chameleon_genshi_template render chameleon_genshi_context N/A N/A N/A N/A N/A sys stdout write N/A N/A N/A N/A join N/A N/A = 80 N/A N/A Template Engine BigTable Benchmark center 80 N/A = 80 N/A - 80 N/A test N/A jinja mako tornado tenjin spitfire django genshi lunar cheetah chameleon chameleon_genshi N/A N/A N/A N/A N/A locals N/A N/A test_ test None N/A N/A N/A N/A N/A sys stdout write N/A     %-20s*not installed*
 test N/A N/A t N/A Timer setup N/A from __main__ import test_%s as bench test stmt bench() N/A N/A N/A N/A sys stdout write N/A  >> %-20s<running> test N/A N/A N/A N/A sys stdout flush N/A N/A N/A N/A sys stdout write N/A 
    %-20s%.4f seconds
 N/A test N/A N/A N/A t timeit number 50 50 N/A N/A N/A N/A sys stdout write N/A N/A - 80 N/A N/A N/A N/A sys stdout write N/A N/A     WARNING: The results of this benchmark are useless to compare the
    performance of template engines and should not be taken seriously in any
    way.  It's testing the performance of simple loops and has no real-world
    usefulnes.  It only used to check if changes on the Jinja code affect
    performance in a good or bad way and how it roughly compares to others.
 N/A = 80