By replacing theme('menu_item_link') with a stripped down, high-performance implementation that avoids theme layer invocation, we're able to greatly reduce the rendering lag. On my installation, typical rendering times (ie. the time spent in admin_menu_footer()) went down by nearly 50 percent.

Comments

smk-ka’s picture

StatusFileSize
new1.81 KB

Dang, missed a E_NOTICE, fixed.

pwolanin’s picture

Is the main benefit from omitting the alias lookups?

sun’s picture

I really think that smk-ka should answer this question, but we had a similar implementation in D5 - completely skipping alias lookups as well as Drupal's theme system, because it simply slows down the rendering while no one has ever tried to override admin_menu's output. This is because we simply output an unordered list containing links and all the styling happens via CSS and JS.

smk-ka’s picture

Omitting alias lookups was already in place since the beginning. While the patched code also skips a few unneeded checks in l(), the main performance increase comes from avoiding the theme() invocation layer, as sun correctly supposed.

sun’s picture

Status: Needs review » Fixed

This saves approx. 14 ms on each page request. Committed to all branches.

Status: Fixed » Closed (fixed)

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