Announcement

Collapse
No announcement yet.

Do conditional statements affect performance?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [vB3] Do conditional statements affect performance?

    This is a completely noob question but I'm a noob and still not sure about this...does having a lot of conditional statements in a template affect performance? I mean does it add to db queries or anything else that would adversely affect speed of the site?

    I want to implement something like this but not sure how it would impact speed of the site?

    <if condition="THIS_SCRIPT == 'index'">

    MY CONDITIONAL TEXT HERE

    <else /><if condition="THIS_SCRIPT == 'forumdisplay'">

    MY CONDITIONAL2 TEXT HERE

    <else /><if condition="THIS_SCRIPT == 'showthread'">

    MY CONDITIONAL2 TEXT HERE

    <else />

    MY CONDITIONAL3 TEXT HERE

    </if></if></if>
    Also, if you note, my conditional text for forumdisplay and showthread are the same, is there a better way to do it than to have an if statement for each one? i.e. is it possible to combine those two?

    NOTE: This is for VB3. I don't know why the thread prefix keeps showing vb4 even though I've selected vb3 when posting.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X