smarty template engine??

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Interesting, but inconclusive, I am very interested to see if heavy featured template files stand up as well as these initial tests. If they do, well played sir. 8)
Will be dipping my fingers in this heavily tommorow as well, although I may wait if your actively modifying features tommorow :P
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Well, here is another speed test for compiling.

Image

In this test the main.tpl is a 71k template file that is fairly complex. It takes Smarty 0.8 seconds and Template Lite 0.2 seconds to compile the same file. Template Lite outputs a slightly smaller compiled file. Smarty outputs a 93k compiled template while Template Lite outputs a 90k compiled template.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

What features are you using? Multidimensional looping? Conditionals?

Keep the great results coming :D
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This app is awesome. The directory problem I was having is that the owner of the compiled and cached folders needs to be 'apache' instead of 'nobody'. Now it works like a charm. I have it set to run through a few tests, some arrays, some conditionals and the like and it is spitting the compiled template out in 0.0029 seconds. I am very pleased. Well done Panama Jack. I think I found my template engine :D .
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

If you are interested I have just released the 1.80 version of Template Lite on Sourceforge.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

I'll have a look at templateLite as well. If Everah is so happy it must be worthwhile checking out :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Thanks for the update AKA Panama Jack
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Downloaded 1.80 and uploaded it. It is working great. One question... was something changed in the parsing of the templates? I noticed the tests that were returning times of about 0.0029 seconds in 1.70 are now returning times of 0.0035 seconds. This is not a major decrease in performance. I was just wondering.

Thanks again. I am so liking this app. On a side note, I heard phpBB is going to be rolling out an instance of Smarty with phpBB 3 (Olympus) as a replacement for their current template parser. Does anyone know if they have given any consideration to Template Lite?
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Thanks :) It has been fun this past month trying to get Template Lite as compatible as possible with Smarty while keeping it small and fast.

There may be a little extra slowdown due to the changes I had to make to the debug code. If I could leave out the debug code it would almost be a straight include of the pre-compiled template.

Now if you are talking about the compile time for compiling a file the very first time that is because of the new _get_plugin_dir() function that can scan through a list of directories looking for a specified plugin. This method is a little slower than the old method that only knew about one directory to look into.

I had to add multiple plugin directory support to be compatible with Smarty. Some commercial applications that use smarty require that ability.

There were some code changes made to variable parsing that may be a tad slower due to the added code checks.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Everah wrote:On a side note, I heard phpBB is going to be rolling out an instance of Smarty with phpBB 3 (Olympus) as a replacement for their current template parser. Does anyone know if they have given any consideration to Template Lite?
It would be a nice feather in my hat if that happened. :D
Post Reply