Testing Smarty 3 beta and RC performance, comparing with Smarty 2

Date: 4 Jun 2010 Comments: 0

Smarty is template engine used for separation front-end HTML for designers and back-end PHP for programmers. We’ve been using Smarty 2 for years. Now when Smarty 3 is in Release candidate stage, its time to think about an upgrade. Smarty 3 is  rewritten from scratch in PHP 5 and its not suppose to work under PHP 4. It promises also faster processing, and more flexible syntax. Lets have a look on few benchmarks I did.

Benchmark consists of fetching 100 times testing template and tests were performed 5 times each. In the template was one for-each loop with 30 printed variables and if condition. For all Smarty versions was used old syntax, and Smarty 3 beta 8 and RC1 were also tested with new syntax. Results are shown below (showing only average values)

a) recompile every time

smarty version: 3b1
60.48ms

smarty version: 3b2
56.26ms

smarty version: 3b5
62.53ms

smarty version: 3b6
54.46ms

smarty version: 3b7
50.87ms

smarty version: 3b8
59.72ms

smarty version: 3rc1
55.58ms

smarty version: 3rc1 new syntax
50.67ms

smarty version: 2
49.92ms

b) fetching without recompile

smarty version: 3b1
0.95ms

smarty version: 3b2
0.91ms

smarty version: 3b5
1.13ms

smarty version: 3b6
1.01ms

smarty version: 3b7
0.95ms

smarty version: 3b8
1.67ms

smarty version: 3rc1
0.76ms

smarty version: 3rc1 new syntax
0.69ms

smarty version: 2
0.50ms

What I can say so far is, that Smarty 3 is not yet faster than its previous version using old syntax. Using new syntax with RC1 makes it perform a bit better, but still its not faster than Smarty 2.


Published by Gaspo in: Smarty, HTML, JavaScript


Leave a Reply


*