Calling variable_set() on an regular page is bad, since it forces a cache clear.

__menu_block_set_menu_trail() does so to "Muck with the static cache of menu_link_get_preferred."

I believe this is only for the life of the page request, so we can alter it temporarily.

CommentFileSizeAuthor
#1 1050040-menu-block.patch1.09 KBagentrickard
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Status: Active » Needs review
FileSize
1.09 KB

And a patch.

JohnAlbin’s picture

Title: Remove variable_set() calls on non-admin pages » Remove performance-killing variable_set() calls on non-admin pages
Status: Needs review » Fixed

All I can say is: DOH!

I was focusing so much on manipulating the cache, I forgot that variable_set() hits the database. And totally didn't realize it kills all the cache too! blargh. :-p

Fixed. http://drupal.org/cvs?commit=494304

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.