[drupal-devel] [feature] Speed up Drupal and improve scalability: On demand module loading

chx drupal-devel at drupal.org
Sun Jul 31 21:00:43 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    module system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Jose A Reyero
 Updated by:   chx
 Status:       patch (code needs review)

This will be never be really efficient. If you have a block from
aggregator, then aggregator needs to be loaded and parsed and store
despite most of the functionality is never used. Quite a lot of modules
play a small part in most pages.

Alas, my split mode development is halted a bit, but I'll revive. My
problem is that drupal_eval needs on the fly tokenizing and wrapping...


Previous comments:

Sun, 31 Jul 2005 15:43:13 +0000 : Jose A Reyero

Attachment: http://drupal.org/files/issues/on_demand_module_loading.patch (7.8 KB)

As Drupal grows bigger, there is too much code not really needed parsed
for each request.

Also, installing more and more modules presents serious scalability
issues, as all the enabled modules are included always for each non
cached page.

This is a first attempt to keep track of *all* module hooks, and only
load modules when they're really needed. I guess it may need some
polishing but the idea is simple enough. 

Currently, as the hook_menu is implemented by most of the modules, and
it is called most of the times, the potential performance improvement
introduced by this mechanism may be small. 

But the thing is, once he have some system for on demand module
loading, hooks can be reworked in the future, to have some real
performance boost. I.e. hook_menu could be easily split in two
'hook_menu' and 'hook_menu_dynamic', thus really reducing acually
loaded modules.

As I said, this is a first step. If there's some interest in this kind
of features, I have some other things in the works aimed at performance
and scalability, like:

- (Simple) Rework of menu system to take real advantage of on demand
module loading
- Expand menu items to be able to include some file where the callback
is in
- Extend module loading for 'loading on path', and maybe 'loading split
- Some API loader, kind of api_invoke....

More information about the drupal-devel mailing list