[BETA] Speedy Templates 0.1.6

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

[BETA] Speedy Templates 0.1.6

Post by ckwalsh »

MOD Title: Speedy Templates
MOD Description: A caching enabled template engine to replace the standard phpBB engine. The main goal of speedy is to be as fast as possible while maintaining compatibility.
MOD Version: 0.1.6

I was talking to some other phpBB users about optimizing phpBB and it was pointed out that most of the page execution time is spent with template.php, not queries. I slightly modified the stock template.php to add caching to see how it would compare. It was faster than the standard template.php, but nowhere close to XS or another template engine posted by someones else. Being competitive, I decided to work on a more efficient engine (modified from the stock engine) and this is the fruits of my labors.

MOD Download: Download

Features
  • Fastest compile and execution times of any template engine available
  • Removes requirement for templates loops to be on their own line
  • Caches compiled templates
  • Option to cache language variable in compiled templates
  • Degrades gracefully if unable to cache templates
  • Able to run php code from templates
  • Easy Installation
The goal of this engine is to be as fast as possible while retaining the functionality of the standard phpBB template. When being designed, php inclusion in templates happened to be a nice byproduct, not a planned feature. If you are looking for added functionality for your templates, such as includes, additional variable availability, or improved ACP style management, I suggest you look at the eXtreme Styles MOD.

Changelog

0.1.0:
  • Initial release
0.1.1:
  • Rewritten code for readability
  • Fixed problem with eval and JumpBox
0.1.2:
  • Fixed problem with wrong values replacing placeholders
  • Added code to generate different filename based on version
  • Added regex to combine back-to-back php tags
0.1.3:
  • Removed static declaration for php4 compatibility
  • Renamed files variable back to standard name for attachment MOD support
0.1.4:
  • Figured out the real problem with the attachment MOD and fixed it. (Requires modification to attach_mod/displaying.php)
0.1.5:
  • Suppresses errors properly when cache is not writable
  • Removed duplicate code from assign_var_from_handle
  • Added Language cache feature. Can be toggled on/off by commenting line.
  • Added automatic checking or language updates. Can be toggled on/off by commenting line.
  • Output buffered pparses to speed up load times
  • Much prettier cache filenames
0.1.6:
  • Whitespace is stripped from compiled templates
  • Created blacklist of template variables prefixed with 'L_' to never cache with the language cache. These are strings that may change from page to page.
  • Split up template.php into 2 files, one containing only the compile function to improve overall parse time.
Specific MOD workarounds
Attachment MOD
Split Topic Type Mod
Last edited by ckwalsh on Sun Apr 06, 2008 4:02 pm, edited 8 times in total.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
mdvaldosta
Registered User
Posts: 353
Joined: Sat Mar 26, 2005 12:26 am
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by mdvaldosta »

I could see this being very useful, and it's nice to see some folks are still modding v2.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: [BETA] Speedy Templates 0.1.0

Post by Peter77sx »

To have alternatives is good. what about those with simple subforums MOD which requieres eXtreme styles MOD to run... :?:
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by ckwalsh »

I have not checked what exactly simple subforums depends on in XS in order to work. I'll try it and update the first post accordingly. If it does work, great. If it doesn't however, I am not sure if this mod will be altered to work. It will depend on whether I can get compatibility without sacrificing speed.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by drathbun »

I have been testing this code extensively (performance testing, not functionality testing) and I can say that the claims of being faster are quite accurate. :) I have been working with Brainy's code in various iterations for over a week now and I am very pleased with the results so far.

I have been blogging about the testing (see signature for link) and expect that I will be reporting the final load test results within a few weeks or so. I am testing Brainy's code against a stock (unmodified) phpBB2 template engine, the current version of eXtreme Styles, and a modified version of the template code from Categories Hierarchy. The testing methods and results will all be in my blog as I get time to write them up.

One of the most important aspects of the testing, in my opinion, is how the template systems hold up under load. I tested one of Brainy's earlier releases (perhaps 0.0.5? :lol:) and it did fairly well but came in third. The eXtreme Styles and Categories Hierarchy code came out on top, within a tiny fraction of each other. Once I put the system under heavier load, the Categories Hierarchy code started pulling away and eXtreme Styles dropped back. So that suggests to me that for very active boards the eXtreme Styles code - while fast - is not the fastest option available. It does, as Brainy pointed out, offer a substantial benefit in the area of increased features however.

I have not yet performed the load testing with this version of the code. The older version slowed down more than eXtreme Styles in the load tests, leaving it in 3rd place and by a wider margin. I am eagerly looking forward to the results after plugging in Brainy's new code. :)

I certainly appreciate the efforts being put forth. As said earlier:
mdvaldosta wrote:I could see this being very useful, and it's nice to see some folks are still modding v2.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
Dog Cow
Registered User
Posts: 2499
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by Dog Cow »

I had been wondering about this "mysterious, new engine" since drathbun mentioned it the other day. Now I've found it. :geek:

I'm going to try this out on my site, which currently uses a stripped-down version of XS, later this evening and tell you how it turns out.

Also... about the Doctor Blog: I had known about it but had never actually thoroughly explored it. My mistake. :oops: I am now in the process of downloading all the articles to read at home.
Peter77sx wrote:To have alternatives is good. what about those with simple subforums MOD which requieres eXtreme styles MOD to run... :?:
Simple subforums MOD, in my opinion, shouldn't have been designed the way it was, such that it requires XS mod. Fortunately, it is very easy to change it so it does not require the XS mod, and I have made these changes to my site and can tell anyone else who wants to know.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by drathbun »

I just completed a load test with 35 concurrent sessions refreshing pages every 7 seconds on my development server at my house. I am not going to publish numbers until I have a chance to review them, but the preliminary indications are that the Speedy Template engine lives up to its name. I am testing 4 different engines (Speedy, eXtreme Styles, Categories HIerarchy, and phpBB2 standard) and Speedy is consistenly one of the top performers. In some cases by a little, and in other cases by a substantial percentage.

I am trying to not have any bias in how I build the tests and interpret the numbers. When I post the final results I will also make available all of my raw data so that anyone can run their own analysis. I do currently use eXtreme Styles on my boards.

Dog Cow (Moof) thank you for the kind words about my blog. :) I was absent from it for many months but this investigation has spawned a new run of posts.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
Dog Cow
Registered User
Posts: 2499
Joined: Fri Jan 28, 2005 12:14 am
Contact:

My results

Post by Dog Cow »

For my main site (Mac GUI City), the template messed up my forums index, and almost all other pages were blank and would not load. :( Trying it on a more "normal" phpBB forum, I got pages to go from 1.3s down to 1.2s (yes, I have old slow machine), so it is definitely faster.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by ckwalsh »

Hmmm... Could you PM me a the compiled templates and the normal templates?
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
eduardor2k
Registered User
Posts: 8
Joined: Fri Jan 21, 2005 10:00 pm
Location: Spain

Re: [BETA] Speedy Templates 0.1.0

Post by eduardor2k »

Hi, your template works fine when i run it in local, but doen't work on my server.

I think it's because some w/r privilieges...

¿could you tell me, what folders need to be chmoed to 777?

Thanks
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by ckwalsh »

The cache folder in the phpBB root directory must be chmodded to 777.

My goal is to have it work well even without that, but there are still some bugs.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by drathbun »

Just wondering if there are any updates to the code at this point. Or even a list of known bugs if that's something that can be provided. I'm getting ready to roll out a major update to my phpBB2 board, should I include this? Or is it ready for "prime time" yet? :)

Thanks, look forward to an update.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by ckwalsh »

The only person who has reported a bug had been DogCow, and I have not been able (so far) to figure out what's wrong.

You and him are the only ones that have contacted me saying you have tried it on your boards (or preferably test boards)

I am busy over the weekend, so I probably won't check this thread again until at least Sunday. I'm too busy playing with robots.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by drathbun »

Have fun. :)

I'm going to push your code up to my beta board and let some other folks beat on it next week. I'll let you know if I encounter any issues.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.0

Post by drathbun »

Ok, have a bug report. Or something, I'm not sure it's actually a bug. I just implemented speedy template on a test site where I have been doing some active development. I noticed some header values for one of my output pages were gone. I restored to the original template engine in use and they came back. So I did some research.

The template variable was {L_FORUM}. It was working fine with eXtreme Styles. What I found was that my php code did NOT specifically set that variable up, so it was being defaulted from somewhere. Speedy Template is missing the default, while eXtreme Styles was finding it.

I first looked in includes/page_header.php as that's where a lot of language strings are set. It wasn't there. I looked in other pages, it wasn't there.

So at the moment I am at a loss. :) It seems that this isn't really a bug, but somehow a feature of eXtreme Styles. There's no problem with going back and resetting language strings in my files, but I now am going to have to go through my board and find out other pages where I might have taken shortcuts and fix them.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Post Reply

Return to “[2.0.x] MODs in Development”