Optimize menu link rebuild

Created on 17 March 2016, over 8 years ago
Updated 20 March 2024, 8 months ago

Problem/Motivation

I got a ticket to investigate our drush cc all because now it is so slow to require a maintenance window. So I did a profile run and realized there's just too much functionality hanging off _menu_navigation_links_rebuild despite it does nothing in 99.99% of cases.

Proposed resolution

Similarly to #512962: Optimize menu_router_build() / _menu_router_save() but disjoint from it, do not rebuild the menu links which belong to unchanged router paths.

This simple approach needs to be refined as menu link properties can be defined in hook_menu. In this case, reuse the existing item query _menu_navigation_links_rebuild to check these properties didn't change. In one more optimization step, exempt known core paths from this query.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

7.0 ⚰️

Component
Menu system 

Last updated about 23 hours ago

Created by

🇨🇦Canada chx

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024