See #513984: Find bottlenecks in HEAD - meta issue for similar issues and reasoning.

Patch adds a static for user_access(), db_is_active(), drupal_is_front_page() and defined() - all inexpensive in themselves, but when called c. ~500 times on some pages, that's ~2,000 function calls we can avoid. Self time is halved, overall time is reduced to a third.

CommentFileSizeAuthor
template_preprocess.patch1.71 KBcatch
patch.png249.23 KBcatch
head.png250.75 KBcatch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

same as #537110: Optimize theme_username(). real problematic if the active user changes during the request, or the active DB. i've been using the multiple DB support in drupal recently and it is quite nice.

when we are avoiding calling a function, even if the function is fast, we have either over optimized or php has completely let us down.

catch’s picture

Status: Needs review » Closed (won't fix)

Probably not worth it.