Download & Extend

Replace menu_rebuild() with variable_set('menu_rebuild_needed', TRUE) for better performance

Project:Drupal Commerce
Version:7.x-1.x-dev
Component:Developer experience
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Title says it all. menu_rebuild() rebuilds the menu immediately. variable_set('menu_rebuild_needed', TRUE) schedules the rebuild for the next page load.
This means that even if you call menu rebuilding code 10 times, the variable_set way will ensure it's not rebuilt more than needed (which is once).

This improves install performance, where we frequently had menu rebuilds happening multiple times for no good reason.

Comments

#1

Status:active» needs review

Easy enough.

AttachmentSizeStatusTest resultOperations
1574746-smarter-menu-rebuild.patch2.22 KBIdlePASSED: [[SimpleTest]]: [MySQL] 3,567 pass(es).View details

#2

Status:needs review» fixed

Great, very nice.

#3

Status:fixed» closed (fixed)

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