Performance benchmarks

All performance benchmarks are included in the distribution
— please try out for yourself, the file
bench/README.txt
has some additional details for how to run each benchmark.

about the benchmarked systems

Qpy
is a templating system almost identical to straight
python and offering convenient and fast
(at least the C based version) html string building with
automatic escaping. From the Qpy readme:
Qpy provides a convenient mechanism for generating safely-quoted html
text from python code. It does this by implementing a quoted-no-more string
data type and a modification of the python compiler.

Amongst currently popular full-featured templating systems for python:
Mako is probably
the fastest pure-python text-based system;
Genshi is probably the
feature-richest XML-based system.

The performance of Evoque and Mako (comparable text-based systems)
seems to be more or less similar —
Evoque seems to be faster for general mixed-task templates,
while Mako seems to do better on loop-intensive templates.

Suggestions to make these benchmarks more relevant
are welcome, especially from anyone with particular
knowledge of the specific templating system in question.

platform

The actual times are coming off a
MacBook Pro with 2.4 GHz Intel Core 2 Duo, 2 GB of RAM,
and Mac OS X 10.5, running Python 2.6.1.

caution

Please remember that performance benchmarks are only relevant
when considered within an entire context, and they may vary
enormously between different combinations of hardware and software,
even if those difference may appear to be very slight.
In addition, two different systems
never quite do precisely the same thing,
however simple and apparently identical the timed task may be.

The numbers from these benchmarks are a tribute to python’s
conceptual integrity — that rewards a straightforward implementation
of a simple design with… amazing performance.