Closed (fixed)
Project:
Bootstrap
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2015 at 14:19 UTC
Updated:
8 Mar 2018 at 18:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mkhamash commentedI just have re-order who we order the search for functions matching needed patterns, it reduced the time spent on perg_grep from 3sec to 0.05 sec.
Comment #2
markhalliwellHm, interesting. I agree this could be done better. I am less concerned because in all reality, this is only a one time performance hit as the registry is cached immediately after it's built.
I'm now following #2339447: Improve theme registry build performance by 85% and will be keeping tabs on it. I'll go ahead bump the priority, but mark as postponed until that issue solidifies more. I would like to mimic whatever is done in that issue as much as possible here.
Comment #3
markhalliwellComment #5
markhalliwellThat issue has been committed to 8.x and is now just waiting for a backport to 7.x.
Here is a patch that mimics that implementation. I will go ahead and commit it.
FWIW, this entire function will not be needed once #939462: Specific preprocess functions for theme hook suggestions are not invoked makes it in. That could be a while before that happens though.
Comment #8
donquixote commentedIs there any recent version of core where
function drupal_group_functions_by_prefix()exists?I see it was added here, https://cgit.drupalcode.org/drupal/commit/?id=db8fda5c7658d2d89953c21d57...
and removed here, https://cgit.drupalcode.org/drupal/commit/?id=5072353
And even if is present in some core versions, what do we gain with this
if (function_exists(..))conditional function declaration?Why not have a
function _bootstra_group_functions_by_prefix()instead?I don't see any static cache in there, so let bootstrap have its own version with _bootstrap_ prefix.