Skip to content

Update each menu manager once per contribution pass - #4567

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:coalesce-menu-manager-updates
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:coalesce-menu-manager-updates

Conversation

@vogella

@vogella vogella commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

When a menu is rendered, every merged menu contribution and every model change made while merging updated the menu manager right away, so a menu with N contributions was rebuilt N times while it was being built. For context menus this happens on every right-click, which is the slowdown with dynamic menu contributions reported in bug 467000 for Papyrus and Capella, which both enable the eclipse.workaround.bug467000 timer to avoid it. processContributions now collects the managers touched during the pass and updates each of them once at the end, without a timer, while updates triggered later by context changes keep their current behavior. At the end of the pass only managers whose menu widget already exists are updated, so submenus whose widgets are created by those updates still fill themselves when first shown. A new test in MenuManagerRendererTest checks that the number of menu bar rebuilds no longer grows with the number of contributions, and PopupMenuDynamicFillTest checks that the dynamic items of a view's context menu are filled as often with 20 contributions as with one (before this change 25 times instead of 6).

Part of #4566

@vogella vogella added the plan Planned bugs/enhancements for a release label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   50m 50s ⏱️ - 3m 22s
 8 547 tests +2   8 307 ✅ +2  240 💤 ±0  0 ❌ ±0 
21 513 runs  +6  20 840 ✅ +6  673 💤 ±0  0 ❌ ±0 

Results for commit e4c547a. ± Comparison against base commit ad7efa0.

♻️ This comment has been updated with latest results.

@vogella
vogella force-pushed the coalesce-menu-manager-updates branch 2 times, most recently from ffe8c8a to 8482c5c Compare November 16, 2026 12:46
Every merged menu contribution and every model change made while
merging updated its manager right away, so a menu with N contributions
was rebuilt N times while it was built. For context menus with dynamic
contributions this runs on every right-click, which is the slowdown
reported in bug 467000 for Papyrus and Capella. processContributions
now collects the touched managers and updates each of them once at the
end, skipping managers whose menu does not exist yet, so submenus still
fill themselves when first shown. A test checks that the dynamic items
of a view's context menu are filled as often with 20 contributions as
with one.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000
Part of eclipse-platform#4566

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the coalesce-menu-manager-updates branch from 8482c5c to e4c547a Compare November 16, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan Planned bugs/enhancements for a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant