[development] The Drupal Diet - Making bootstrap faster

Gabor Hojtsy gabor at hojtsy.hu
Thu May 3 09:15:38 UTC 2007


Larry Garfield wrote:
> Sooo...  Now that the three of you who made it all the way through this email 
> have gotten here, thoughts on this approach?  Any caveats I'm missing?  Any 
> use cases I don't know about?  Does this have a snowball's chance in hell of 
> being accepted?
> 
> <dons flame-retardant suit>

Well, we are just getting a locale module cleanup patch in, which does 
lead to such an optimization. Before the patch, we had proxy functions 
in locale.module to include locale.inc and call the appropriate 
functions (a hundred of useless lines of code). After the patch all 
locale.module menu items are going through this function:

/**
  * Wrapper function to be able to set callbacks in locale.inc
  */
function locale_inc_callback() {
   $args = func_get_args();
   $function = array_shift($args);
   include_once './includes/locale.inc';
   return call_user_func_array($function, $args);
}

Dries noted that we might make this more generic, but that is for a 
separate menu improvement. Seems like this is coming along now, so we 
will be able to simplify how locale module works after your patch gets 
submitted. :)

PS. Locale module is such a beast that it only has admin pages and 
forms, so we will have a 425 line lightweight locale module, and a 2066 
line heavyweight locale.inc after the patch gets accepted. Also 120 
lines of that 425 are the _help and _menu hooks, which would only be 
required on a small fraction of the pages (we only provide admin help 
for example).

Gabor


More information about the development mailing list