[development] Strip out theme functions into a .theme file

Adrian Rossouw adrian at bryght.com
Fri Aug 4 10:05:40 UTC 2006


Also. the way the code works at present is that it creates anonymous
functions in php, with the contents of the file,
and then caches those.

We got it to within 5-10% of drupal core performance, but the biggest issue
was theme_link. I'm not even altogether convinced
theme_link (or theme_table for that matter) should be theme functions.

ALSO.. since we are doing this to be friendly to designers, moving them all
to a single .theme file is
still nowhere near as friendly as just 'copy this file to your theme
directory to override'.

Doing it this way means you never have to write silly phptemplate stubs
again, something which
shouldn't have been necessary in the first place.

On 8/3/06, Larry Garfield <larry at garfieldtech.com> wrote:
>
> On Thu, August 3, 2006 1:32 pm, Jakub Suchy said:
> >> Adrian seems to think it is not a performance issue though.
> >
> > Imagine you have 15 activated modules. Every module has 2 theme
> > functions, which makes it 30 fopen() calls for every page load. This IS
> > performance issue.
>
> That's assuming that you use all 30 theme functions on every page.  You
> may only use 4-5.  Remember that the most frequently-used theme functions
> are those that are already setup as separate files via the template
> engine: page, node, block, etc.
>
> I'm open to suggestions on how to properly benchmark what the performance
> difference would be here.
>
> --Larry Garfield
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20060804/9027392c/attachment.htm


More information about the development mailing list