Page 1 of 1
Which content is faster
Posted: Wed Oct 11, 2006 7:16 pm
by sloecoach
Does anyone know which methods of injecting content into a page are faster than other? I'm looking to optimize the speed of the page rendering and was wondering. All three methods below can be used to selectively show a block of html, assuming it's the same block of html, which is faster?
- global content blocks
- user defined tags
- multiple templates
- content blocks using the {content block="block2"} method
I've noticed the last method slows down the admin page for adding content (probably just because it has to load 2 FCK editors. There also seems to be a connection between recent updating and slow page rendering.
Re: Which content is faster
Posted: Wed Oct 11, 2006 7:19 pm
by calguy1000
Unless I'm really really incorrect, global content blocks (gcb's), udt's, and multiple content blocks, should be almost the same on the frontend.... they're all loaded from the database on initialization, and executed inline, though gcb's are cached, and so are templates.
Re: Which content is faster
Posted: Wed Oct 11, 2006 7:56 pm
by sloecoach
So if UDTs take 2 tags to display something (first one to determine the page and the second to output the content) would that make them slower than say, using multiple content blocks where if the block is empty it just displays nothing? for example:
say i have 2 UDTs. one is a switch function that says, what page are you on, here are your variables. 'oh, you're on the homepage, variable $rightSideBox = 'some code'', or 'oh, you're on the about us page, $rightSideBox=' ' and then in the template it calls a second UDT which just echos the variable $rightSideBox (whatever it may contain)
or
multiple content blocks in the template:
{content}
{content block='rightSide'}
and in the 'rightSide' content there is either something or nothing.
or
GCBs in the page content:
{global_content name='Right Side'}
would all these be approximately the same?
sloe
p.s. now that I think about it the first one could be all in one tag put where you want the output to go.
Re: Which content is faster
Posted: Thu Oct 12, 2006 4:23 pm
by Pierre M.
If you really care about performance, you should serve only static content :
http://forum.cmsmadesimple.org/index.ph ... 678.0.html
PM
Re: Which content is faster
Posted: Fri Oct 13, 2006 1:09 am
by sloecoach
That certainly seems like a good solution to the problem. The discussion in that other thread doesn't seem to have come to a satisfying conclusion. Instructions for implementing static pages functionality would be helpful.
I'm not super-worried about it at the moment. Most of the site's i'm doing are not very high traffic, but I'd like to figure out all the bottlenecks now, while i've got time, and not when I've got someone yelling at me.

I just thought if I was doing something overtly stupid that was slowing my down, I wanted someone to slap me.
sloe
Re: Which content is faster
Posted: Sun Oct 15, 2006 4:16 pm
by Pierre M.
sloecoach wrote:
That certainly seems like a good solution to the problem. The discussion in that other thread doesn't seem to have come to a satisfying conclusion...
...YET.
But if it is only Smarty tuning, one dev will try it hopefully.
I can't try it myself. May be you can ?
I'm optimistic the need for the feature will meet a competent dev or poweruser to tune Smarty.
PM