Minor optimization of theme(); prevent calling include_once multiple times when calling a theme function multiple times.
| Comment | File | Size | Author |
|---|---|---|---|
| theme.patch | 633 bytes | casey |
Minor optimization of theme(); prevent calling include_once multiple times when calling a theme function multiple times.
| Comment | File | Size | Author |
|---|---|---|---|
| theme.patch | 633 bytes | casey |
Comments
Comment #1
casey commentedProbably not very much.
Comment #2
moshe weitzman commentedThe unset could potentially outweight the cost of include_once. Remember those include_once calls operate on an absolute path so they are quick. Reopen if you ever make benchmarks for this.
Comment #3
casey commentedI am ok with the won't fix, but an unset outweighting include_once...
Comment #4
catchNeeds benchmarks means it needs review, not that it's won't fix.
Comment #5
dries commentedWe have a tag for that!
Comment #6
effulgentsia commentedSubscribing. My hunch is it's a small net improvement, because the penalty of an unset would only be paid once per theme hook, so I can't imagine any page where it would be detectable, and the savings would be had on every invocation of a theme hook (after the 1st one), so at least in theory, that could add up to something measurable. The question is: is there a use-case of a theme hook that has a 'includes' that is called enough times per page request for the savings to be worth the extra line of code (or perhaps more to the point, worth someone's time to generate the benchmarks and drive the issue along).
Comment #7
catchtheme.patch queued for re-testing.
Comment #8
xjmComment #9
joelpittetHmm tried to benchmark this but couldn't apply and after fuzzing it I got a bunch of errors. I'd consider a won't fix too.
Comment #10
catchYep. 2010 is a long time ago.