Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2012, 08:44 PM
Chris8's Avatar
Chris8 Chris8 is offline
 
Join Date: Nov 2009
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Does using replacement variables has imapct on performance?

Does using replacement variables has impact on performance?
Let say I will use in templates in hundreds of places one replacement variable, will it have any impact on performance when compared to using static text?
I'm wondering if I should use replacement variable or to do manual edits for all child styles that will reflect the difference between main and child styles. Both ways seems to be ok, I'm just not sure what would be better for performance. Altering loads of child style templates or using one single replacement variable that will be different for all styles???

Yup, I know I repeat myself, it's just for better understanding.
Reply With Quote
  #2  
Old 06-10-2012, 11:23 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It can, yes. I doubt it would be a huge effect, but if you have many of them, and your site is really, really busy, and you don't have a great server, then you may see an affect. Could be a small affect, but still and affect.
Reply With Quote
  #3  
Old 06-11-2012, 05:10 PM
Chris8's Avatar
Chris8 Chris8 is offline
 
Join Date: Nov 2009
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Lynne.
So, it would be better for performance to alter child styles?
I'm asking because I'm not sure how theme system works. The templates are inherited from parent style. When I alter most of the child templates then will they behave like independent templates or will everything be inherited and only the changed code pieces will be pulled out of database? I'm not sure how it works.
Reply With Quote
  #4  
Old 06-11-2012, 11:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have a Parent style and you have a footer template in it, then you have a Child style that is a child of the Parent..... if you do not edit the footer template in the Child style, then it will use the footer template from the Parent style. However, if you edit the footer in the Child style, then any edits you do to the footer in the Parent style will not get magically merged into the Child style footer template (thus, the Child style modified footer template is independent of the Parent style footer template).

As for the better performance, it's hard to say since we know nothing about your site or server or anything. If it were me, I'd go the easy route of using Replacement Variables and if the server loads are fine, then go with it until sometime in the future when the server loads are no longer fine.
Reply With Quote
  #5  
Old 06-12-2012, 12:05 AM
Chris8's Avatar
Chris8 Chris8 is offline
 
Join Date: Nov 2009
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Well, that's what I was guessing too, cause that was logical, however, sometimes things are not that simple as they seem to be and it's better to ask and to make sure just in case. ^^'
I think I get it now.
And I think I will never get to know what would be better in terms of performance so, I will just proceed with one option.
My server load averages are always at 0 cause the site is still in development stage and not live. I'm not worrying about future sever needs but I always try to think 5 steps forward with everything... just in case.
Reply With Quote
  #6  
Old 06-12-2012, 12:57 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Chris8 View Post
... And I think I will never get to know what would be better in terms of performance so, I will just proceed with one option.
I'm pretty sure that if you edit a lot of templates in a child style to add static text, there would be no performance difference over using the parent style. Like Lynne said, there's no on the fly merging going on - each style is just a list of template ids. If a child style hasn't modified a template, then the id for that template will be the one from the parent style. The replacement variables are done by doing a preg_replace() on the entire document as one of the last steps before it's sent, so it's got to add some processing time, but I agree with Lynne when she says that unless you have a busy server it's most likely not going to be a problem.

(Sorry if I just repeated what you already understood - it sounded like maybe you still had a question).
Reply With Quote
  #7  
Old 06-13-2012, 10:39 PM
Chris8's Avatar
Chris8 Chris8 is offline
 
Join Date: Nov 2009
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I understand. I just modified child templates where it was necessary. It's possible that I would modify them anyway so it's best choice I think. Replacement variables are very useful too though and I used them to alter some bbcodes that are dependant on styles.
Thank you both for making things more clear.
I always try too look up my questions before asking sometimes though I can not find answers so I ask.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04180 seconds
  • Memory Usage 2,217KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete