Which content is faster

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
sloecoach

Which content is faster

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Which content is faster

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
sloecoach

Re: Which content is faster

Post 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.
Pierre M.

Re: Which content is faster

Post 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
sloecoach

Re: Which content is faster

Post 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
Pierre M.

Re: Which content is faster

Post 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
Locked

Return to “CMSMS Core”