phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Memory Concerns with using hooks for MODs

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.1/Ascreaus followed by 3.2/Arsia.

Memory Concerns with using hooks for MODs

Postby VSE+ » Sat Jan 29, 2011 7:56 pm

I have one question/concern regarding this new push towards using hooks to modularize MODs in 3.1 and beyond...

How will this impact memory usage, and has this been considered?

Among the few MODs I have already installed that have switched over to using the Hook system instead of the traditional core file hacking method, I have noticed those MODs increase the memory usage - board wide! It appears that hooked MODs will have their code/functions loaded on every page of a forum, even when they are not needed or used on that page.

For example, I have a MOD that only acts on the viewtopic page. When viewing another page, say the board index, the memory usage goes up about 60kb when using the hooked version as opposed to the older MOD method. Of course on the viewtopic page, the memory usages are identical, because that is where the MOD is actually needed.

So...if people add lots of MODs to their board, and they are all hooked, isn't it possible that memory usage can get out of control, since the hook system appears to load the code/functions (even though they may not be needed to execute) on every page, rather than just where the MOD is actually needed?
User avatar
VSE+
Registered User
 
Posts: 205
Joined: Mon Mar 08, 2010 9:18 am

Re: Memory Concerns with using hooks for MODs

Postby naderman » Tue Feb 01, 2011 6:33 pm

The hook system does not even exist yet. So I assume you mean the system that exists in 3.0 which was built to embed phpBB into another software. That system executes code on every page load simply because that makes sense if you want to embed the entirety of phpBB in another software. The MOD hook system in 3.1 will not load MOD code that is not needed.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1649
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: Memory Concerns with using hooks for MODs

Postby VSE+ » Sun Feb 13, 2011 6:25 pm

naderman wrote:The hook system does not even exist yet. So I assume you mean the system that exists in 3.0 which was built to embed phpBB into another software. That system executes code on every page load simply because that makes sense if you want to embed the entirety of phpBB in another software. The MOD hook system in 3.1 will not load MOD code that is not needed.


cool, that is good to know.
User avatar
VSE+
Registered User
 
Posts: 205
Joined: Mon Mar 08, 2010 9:18 am


Return to [3.x] Discussion

Who is online

Users browsing this forum: No registered users and 21 guests