Compile vs Compiled Speed

Skip to first unread message


Oct 6, 2009, 10:11:55 AM10/6/09
to Smarty Developers
I did some speed testing to check if Smarty 3 keeps up the promise of
speed, and here are the results (The results are not from debug
console, it's my own benchmark class.):

Template NOT compiled:
Smarty 2 page load: 0.475
Smarty 3 page load: 1.825

Template compiled:
Smarty 2 page load: 0.319
Smarty 3 page load: 0.122

compile_check = true
force_compile = false

I took average results from 20 runs. That actually means your
development will be slower since Smarty 3 takes much more time to
compile template, but when template is compiled my results show it's
3-4 times faster than Smarty 2. I am not sure if you can work it out a
bit because compile is significantly slower, I had some pages compile
in 5+ seconds while it takes only 1 second in Smarty 2, but it is
already great as is - because run time is what counts. :)

Keep up the good work :)


Oct 6, 2009, 12:27:40 PM10/6/09
to Smarty Developers

Yes compiling will be always slower in Smarty3 because of the lexer/
parser approach. But maintenace and dealing with new features is much
much easier now. As normally you compile just once it should not be a
big issue.

I'm currently reviewing the code for optimizations but concentrate at
the moment on the rendering and caching process to get the best
possible speed out of that.

Regards Uwe
Reply all
Reply to author
0 new messages