Question: Our new D7 site was running very slowly so I did some profiling with devel/xhprof and found that D7 was doing millions of preg\_grep function calls within drupal\_find\_theme\_functions() in theme.inc. This happened on every page load.

It's my understanding that the drupal\_find\_theme\_functions function should only be called when the theme registry is being rebuilt - am I correct in that?

I made sure that "rebuild theme registry" was off in devel, and then disabled devel entirely. However, I'm still seeing those millions of function calls to preg\_grep in drupal\_find\_theme\_functions on every page load (I added a piece of code to theme.inc to log when the function was called).

We're using a theme based on Omega and if we are rebuilding the theme registry each time I'm not seeing how/why it's happening. We're turning off as many contrib modules as we can in the meantime. Any help/advice would be MUCH appreciated!!

Answer: 
Try this code:

```
/**
 * Implements hook_preprocess_taxonomy_term().
 */
function YOURTHEME_preprocess_taxonomy_term(&$variables) {
  if ($variables->vid == YOUR_VOCABULARY_ID) {
    $variables['theme_hook_suggestions'][] = 'taxonomy_term__authors';
  }
}

```
Each term has link taxonomy/term/TERM\_ID and if you want vocabulary based theme(customize HTML markup) on terms pages then you can use "Taxonomy Views Integrator" module.

On particular vocabulary edit page you can select views template.
And in that views template you can write customize html so, that pages with taxonomy/term/TERM\_ID get themed.