Templates and site efficiency

Templates and site efficiency

Monday 20 October 2003 8:10:37 am - 4 replies

Author Message

Eirik Alfstad Johansen

Tuesday 21 October 2003 1:06:30 am

Hi Tore,

Though someone else might know the actual answer to this question, if you don't get it, I would try the FAQ page with and without the node_view_gui and then comparing the run times (turn on debugging to view them).

Sincerely,

Eirik Johansen
Netmaking AS

http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Tuesday 21 October 2003 1:47:25 am

Cache is the key here. We use the same structure on this page:

http://www.pobox.co.uk/po_box/frequently_asked_questions

That is, use a faq template with node_view_gui calls to include the faq items themselves. Once the cache is built the result is a single page to display.

Performance will likely depend on the number of items in your faq - number of templates to pull in - but i don't see it being a problem.

Paul

Tore Skobba

Tuesday 21 October 2003 2:39:28 am

Hi all.. Made one modular solution with one template for each faq questions. Then made another solution where the output of each faq question where done in each faq category.

Did a few runs and the results are below here:

With faq_qeustion template:
Clear cache loading of page took: 1.3249 sec
then reload four times gave these times:
0.6021 sec
0.5205 sec
0.4966 sec
0.5110 sec

Without faq_question template:
Clear cache, loading of page took 1.1789 sec
then reloead four times gave these times:
0.4056 sec
0.4084 sec
0.4357 sec
0.3989 sec

As you can see this is not very much statistical material, but the results are consistent in that the version with the fewest templates are the fastest. Note that I only had 2 faq questions, as such the difference in templates between the two runs where 2)

Cheers.

Paul Forsyth

Tuesday 21 October 2003 3:45:52 am

Just had a play with our site with cache and i can see that the cache is built based on each class. So there is one cache file for the main faq class and another for the faq items it pulls in. This may explain the discrepency you see - files still need to pulled in. However, since they are already processed the overhead isn't much and should scale nicely.

From a maintence point of view i would prefer the seperate class approach. It saves me more time.

Paul

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.