Welcome to Pluggable/Tunable Template Benchmark

Last Update: 10 Apr 2008

Use setup to tune the benchmark for Your production environment.

How to add one more template engine?
Download the source.

PHP version: 5.2.17
Eaccelerator (bytecode caching): DISABLED

Feel free to add and modify.
Inform me about your changes please.
And keep these lines.

Ilia Kantor iliakanNO-SPAM@gmail.com

Setup

Basically, benchmark loops the block with <var_count> variables and <text_length> plain text.

The block is looped <block_count> times.

Tune these params to model from simple variable replacement to pagination loops.

The process is repeated <iterations> times to get the average.

Extra first pass is used to make sure template caches worked before actual benchmark.

block_count / 50 text_length / 1000
var_count / 9 iterations / 5
 
php-templates will not be run: php extension required.
NEngine nameTimePercentageChecksumTest
1php0.000287100%52700
2Beilpuz0.000366128%52700
3vsprintf0.000526183%52700
4outline0.000568198%52700
5dwoo0.000583203%52700
6smarty0.000793276%52700
7str_replace0.00106369%52700
8phemplate0.001475514%52700
9fasttemplate0.001985692%52700
10templatelite0.002359822%52701
11vtemplate0.0034261194%52700
12Sigma0.0037321300%52700
13xslt0.0039041360%51701
14IT0.0040541413%52700
15ultratemplate0.0043191505%52700
16templatepower0.0061642148%52700
17bugitemplate0.0079472769%52700
18tinybutstrong0.0088453082%52700
19phplib0.0100363497%52700
20xtemplate0.0235068190%52700

Engine comments.

Blitz - PHP extension in C, single PHP call in this test (unnatural), that's why that fast. But it's really fast anyway ;)
PHP - pure PHP with <?=var?> and output_buffering.
str_replace - PHP with variable replacement using str_replace and concatenation of filled blocks.
Smarty, Sigma - compiled templates caching is on.
php-templates - PHP extension in C.
XSLT - libxslt+libxml2(PHP5). XML generation time is counted also. Checksum may be wrong cause of spaces.
TinyButStrong, vsprintf - thanks to Christophe Colombier
Outline, TemplateLite - courtesy of Rasmus Schultz
IT, Sigma - members of PEAR package.
Dwoo - from Jordi Boggiano.
Beilpuz - by Mike Reiche.