Bug 270795 - [Contributions] [perfs] Regression on ObjectContributionsPerformance#testObjectContributions test
Summary: [Contributions] [perfs] Regression on ObjectContributionsPerformance#testObje...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 RC1   Edit
Assignee: Paul Webster CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords: performance, test
Depends on:
Blocks: 270824
  Show dependency tree
 
Reported: 2009-04-01 10:21 EDT by Frederic Fusier CLA
Modified: 2009-05-13 09:20 EDT (History)
2 users (show)

See Also:
pwebster: review+
bokowski: review+


Attachments
Patch to change description (1.60 KB, patch)
2009-05-05 10:25 EDT, Oleg Besedin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2009-04-01 10:21:14 EDT
Verifying results for build I20090331-0901, it appears that there's a 
regression on 'ObjectContributionsPerformance#testObjectContributions:limited selection, limited contributors()' test.

This test is currently commented but for a regression between 3.1 and 3.2. So, this comment must either be removed and the regression investigated or updated to explain the difference between 3.4 and 3.5...

Looking at history, it seems that the regression got introduce with build I20090120-0920...
Comment 1 Oleg Besedin CLA 2009-04-16 16:15:00 EDT
The cause of the slowdown appears to be the change made in the bug 231611.

The test populates a popup menu which includes "standard" menu items matching URI "popup:org.eclipse.ui.popup.any". In 3.4 that contained only one menu item ("org.eclipse.debug.ui"), in 3.5 the new menu was added in the "org.eclipse.ui.ide.application".

The call stack that leads to the slowdown is:

   WorkbenchMenuService.addContributionsToManager() line: 663	
   WorkbenchMenuService.populateContributionManager() line: 656	
   SlaveMenuService.populateContributionManager() line: 203	
   SlaveMenuService.populateContributionManager() line: 76	
   PopupMenuExtender.addMenuContributions(IMenuManager) line: 355	
   PopupMenuExtender.menuAboutToShow(IMenuManager) line: 333	
   ObjectContributionTest.assertPopupMenus() line: 400	

As a result, the #addContributionsToManager() method has two factories in 3.5 and only one factory in 3.4.

The test framework runs confirm this hypothesis. For my computer:
- CPU time: current in 3.5 is 2.48sec; went to 2.24sec with menu removed
 (the 3.4 baseline is 2.22sec)
- Elapsed time: current 3.5 is 1.61sec; went to 1.44sec with menu removed
 (the 3.4 baseline is 1.41sec)

I am not sure if there is a good way to isolate this test from the "popup:org.eclipse.ui.popup.any" contributions. The test uses an active workbench part (which happens to be an outline view) to populate the pop-up. 
Comment 2 Boris Bokowski CLA 2009-04-28 12:31:08 EDT
We should either add a comment to the test, make the test more stable against changes like the one found by Oleg, or optimize the regression away even if it means optimizing something else.
Comment 3 Paul Webster CLA 2009-05-05 10:02:57 EDT
popup:...any has the effect of being contributed to any popup menu registered with getSite().registerContextMenu(*).  I'm not sure of a way to isolate an objectContributionTest without making it more artificial ... i.e. slicing code out of PopupMenuExtender or providing a testing "don't go through IMenuService code" hook.

PW
Comment 4 Oleg Besedin CLA 2009-05-05 10:25:41 EDT
Created attachment 134431 [details]
Patch to change description

The test measures the time it takes a pop-up menu to show up. Due to the change to bug 231611 the pop-up menu now has 3 items while in 3.4 it used to have 2 items.
Comment 5 Paul Webster CLA 2009-05-11 12:09:34 EDT
Released for I20090511-2000
PW
Comment 6 Frederic Fusier CLA 2009-05-13 09:20:59 EDT
Verified for 3.5RC1 using I20090512-2000 results (comment has been updated)