[drupal-devel] [feature] Lazy loading of theme system
moshe weitzman
drupal-devel at drupal.org
Mon Mar 28 13:38:44 UTC 2005
Issue status update for http://drupal.org/node/19590
Project: Drupal
Version: cvs
Component: theme system
Category: feature requests
Priority: normal
Assigned to: moshe weitzman
Reported by: moshe weitzman
Updated by: moshe weitzman
Status: patch
Attachment: http://drupal.org/files/issues/init_theme_lazy.patch (1.04 KB)
Don't initialize the theme system during common.inc. Instead, wait for
the first call to theme() and do it there. There are 2 big benefits:
- sometimes you never call theme(), and thus don't ever need to include
theme engine and template. thats a performance win. examples include RSS
feeds, blogapi, distributed auth, ...
- module developers are currently forced to use hook_init() to set a
custom theme for a given page view. with this patch, they can wait and
do this during hook_menu(). Without this delay, module developers are
tempted, sometimes forced, to break the bootstrap and inadvertently
load all the modules for every page view. I almost did this in Organic
Groups module, where each group can shoose its own theme. You can break
the bootstrap by doing something as simple as node_load().
This is a tiny patch, and merits consideration for 4.6, i think.
moshe weitzman
More information about the drupal-devel
mailing list