Thursday, July 19, 2012

Python Fastest Template Engine

What is the fastest template system for Python? See also:
  • Comprehensive benchmarks for various template include, extends and widget directives are here.
The benchmark is based on wheezy.template big table test for rendering a 10x1000 HTML table in unicode. Latest available versions (April 2, 2015):
  1. bottle 0.12.8
  2. chameleon 2.22
  3. cheetah 2.4.4
  4. django 1.8
  5. jinja2 2.7.3
  6. mako 1.0.1
  7. durusworks qpy 1.2
  8. spitfire 0.7.15
  9. tenjin 1.1.1
  10. tornado 4.1
  11. web2py 2.0.9
  12. wheezy.template 0.1.159
Let setup virtualenv environment:
virtualenv env
env/bin/easy_install -O2 bottle chameleon cheetah django \
  jinja2 mako tenjin webext tornado wheezy.html \
  wheezy.template
Download bigtable.py test:
wget https://bitbucket.org/akorn/wheezy.template/raw/tip/demos/bigtable/bigtable.py
And run it:
env/bin/python bigtable.py