vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   [How to] Cut down on memory usage (https://vborg.vbsupport.ru/showthread.php?t=104657)

99SIVTEC 02-03-2006 07:06 PM

Just having the plugin system turned on uses extra queries. A good programmer ca hack vbulletin in such a way as to add few if any extra queries, but the system itself is what adds the extra queries.

Quote:

Originally Posted by MarcoH64
If coded for saving memory(ie. 99% of executable code in include files), a plugin don't need to use much memory, nor does it need to use more queries or slow down significantly.


Marco van Herwaarden 02-03-2006 07:10 PM

Quote:

Originally Posted by 99SIVTEC
Just having the plugin system turned on uses extra queries. A good programmer ca hack vbulletin in such a way as to add few if any extra queries, but the system itself is what adds the extra queries.

Not sure on the exact amount of added queries when the plugin system is turned on, but it is not much, and they are good optimiyed and won't effect your board much from a performance point of view.

Remember that the number of queries is almost irrelevant for performance, it is the execution time that counts.

PennylessZ28 02-03-2006 07:21 PM

Seems to me that just putting the plugin code in a php file and replacing it with

include('./plugins/my_script.php');

Doesn't work 100%

Marco van Herwaarden 02-03-2006 07:45 PM

Nobody ever said that things would work without any modification.

Andreas 02-03-2006 07:57 PM

1. Turning the Plugin System On or Off does not have any impact on the amout of queries.
2. Memory Footprint is not a such a big issue. In most cases, forumcache (which is loaded on every page) for example will be a lot bigger then the plugins.

Having to eval() the code all the time, that is an issue.

Therefore, complex plugin code (especially in high-traffic places like global.php, postbit, showthread, forumdisplay, etc.) should be moved out to include files.
(Could even be done automatically. I wrote a proof-of-concept hack that writes include-files if the plugin-code on one hook is > X bytes long.)

Andreas 02-03-2006 07:59 PM

Quote:

Originally Posted by HR3rdGen
Seems to me that just putting the plugin code in a php file and replacing it with

include('./plugins/my_script.php');

Doesn't work 100%

Hmm ... what problems did you have?

If you use
PHP Code:

include(DIR '/plugins/my_script.php'); 

it should work 100%.

PennylessZ28 02-03-2006 11:17 PM

Quote:

Originally Posted by Andreas
Hmm ... what problems did you have?

If you use
PHP Code:

include(DIR '/plugins/my_script.php'); 

it should work 100%.

I converted two plugins to test this. VBSHOUT for one, which failed 100%.

And then estakis referral stats. That one works, half way.

It's depositing all the code in raw format on the page.

Crazy I tell ya.

Andreas 02-03-2006 11:22 PM

Erm ... are you sure you put

Code:

<?php
// Plugin Code here
?>

in the files?

PennylessZ28 02-03-2006 11:57 PM

Quote:

Originally Posted by Andreas
Erm ... are you sure you put

Code:

<?php
// Plugin Code here
?>

in the files?

Yes I'm stupid. I forgot that. LMAO

Trigunflame 02-09-2006 08:20 PM

Solution to all your problems :)

https://vborg.vbsupport.ru/showthread.php?t=107315


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

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.02412 seconds
  • Memory Usage 1,739KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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