perf: cache menu tree lookups#10022
Conversation
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10022 +/- ##
============================================
+ Coverage 59.55% 61.11% +1.55%
- Complexity 3812 4122 +310
============================================
Files 677 708 +31
Lines 23248 23855 +607
Branches 1500 1572 +72
============================================
+ Hits 13846 14579 +733
+ Misses 8764 8520 -244
- Partials 638 756 +118 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



What type of PR is this?
/kind improvement
What this PR does / why we need it:
This PR caches menu tree data used by the theme menu finder, so repeated finder calls can reuse an already-built tree instead of listing all menu and menu item extensions every time.
It extracts the tree-building logic into
MenuTreeCache, shares in-flight loads, and invalidates the cache when menu-related extension watch events arrive. It also publishes aMenuItemReconciledEventafter menu item reconciliation so status changes that affect rendered menu labels and links refresh the cached tree.Which issue(s) this PR fixes:
None
Special notes for your reviewer:
This PR was prepared with AI assistance and reviewed before submission.
Validation:
./gradlew :application:test --tests "*MenuFinderImplTest" --tests "*MenuItemReconcilerTest"./gradlew :application:spotlessCheck :application:testDoes this PR introduce a user-facing change?