vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Code Optimisation - Anyone got anything that can optimise your vB files? (https://vborg.vbsupport.ru/showthread.php?t=45293)

Erwin 11-02-2002 09:11 AM

No point having 3 $templatesused - combine them into 1 line.

Any template being eval() that's not in $templateused will be 1 query. No question about it.

To see exactly what queries are being run, add this line to your config.php file in your admin directory:

debug=1

Then run any php file with ?explain=1 at the end of the file, and you will see the list of queries being run.

Remember to remove that line from config.php - it's a security risk.

Brad 11-02-2002 09:11 AM

N9ne: that post was directed at hellsatan, not erwin ;)


to see the querys on any page add:

PHP Code:

$debug "1"

to the config.php file then put &explain=1 at the end of any url on your vbulletin you wish to see the query's for, remember to trun off debug mode when your done as it poses a risk.

Brad 11-02-2002 09:13 AM

Erwin you just beat me to it ;)

Tigga 11-02-2002 11:03 AM

Quote:

Originally posted by Erwin
No point having 3 $templatesused - combine them into 1 line.
Isn't it done that way to kinda group them together for different circumstances? Ex - All templates that are used when a user is logged in are in one set, all templates for a guest are in the next set, and all templates used by both are in another (or something to that effect). I could be wrong about that, but I thought it was done like that for a reason.

Scott MacVicar 11-02-2002 11:12 AM

its also just to make it easier to read, its not going to execute any extra queries or anything.

You can end up doing more table scans than needed if you combine all 3 queries as Anime-Loo said.

Chris M 11-02-2002 11:21 AM

Forumhome page was : 38 Queries
Forumhome page is now : 32 Queries

Yey!:)

Satan

Chris M 11-02-2002 11:26 AM

PPN - How would you do that?

Satan

Chris M 11-02-2002 01:01 PM

I found something out guys...

If I were you, I would go through all your files, and add :

Code:

,error_nopermission
to the end of templatesused...

There are no end of files without it;)

Satan

Tigga 11-02-2002 01:06 PM

In most cases that will actually slow things down (just a bit, but still). Think about how often that page is displayed, as opposed to how often it won't be. It's better to not have the template pulled from the database every time a page is loaded when it is only used maybe 2% of the time.

Chris M 11-02-2002 01:13 PM

Have you looked at the vB files, recently if ever?

Have you seen how many times:

PHP Code:

    show_nopermission(); 

occurs?

Satan


All times are GMT. The time now is 09:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01107 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete