[development] Conditionally include include files

Gabor Hojtsy gabor at hojtsy.hu
Tue May 22 09:25:03 UTC 2007

Locale module is a very easy target there, since it already includes 
most of its code from locale.inc, and it has a custom menu callback 
which dates back to the time before this patch landed. It should be easy 
for someone to pick up and update to this new functionality!


Robert Douglass wrote:
> I suppose it goes without saying that people interested in working on 
> this seriously should coordinate and perhaps stake claims to modules so 
> that efforts aren't duplicated.
> Robert
> Dries Buytaert wrote:
>> Hello world,
>> I just committed patch http://drupal.org/node/140218, which enables us 
>> to split module files into multiple (include) files.  With this patch, 
>> it is the router's (menu system) responsibility to load the correct 
>> include file -- i.e. the include file that has the active callback's 
>> code.  In other words, depending on the active callback, Drupal can 
>> conditionally load include files rather than having to load the entire 
>> world.
>> This is an important patch as it enables us to load less code -- 
>> hence, it can offer an important performance boost.  Kudos to all the 
>> people who helped make this possible.  :-)
>> The patch that has been committed implements the system to accomplish 
>> that, but doesn't actually split modules.  There is only one new .inc 
>> file that has been committed with this patch that acts as an example.
>> Now this patch landed, the natural next step would be to fire up your 
>> profilers, and to split a couple more big modules in Drupal core -- 
>> and to report back the performance improvements that you observe with 
>> that.
>> -- 
>> Dries Buytaert  ::  http://www.buytaert.net/

More information about the development mailing list