DESCRIPTION

Bug 467000 - [Popup Menu] Too many refreshes when building Dynamic Menus

Change-Id: Ida80e24773a4b866757e5ffd457183691e2343b1
Signed-off-by: Myah Faulkner xxx@xxx.xxx
Signed-off-by: Teagan Marsh xxx@xxx.xxx


COMMENTS

author: Teagan Marsh
date: 2015-05-29 15:33:01.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2015-05-29 15:33:08.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/5826/

-------------------------------------
author: Teagan Marsh
date: 2015-05-29 15:34:38.000000000

Patch Set 2:

I tweaked this patch to use Display#asyncExec() instead of creating a new thread pool for each renderer, and minor method rename to indicate intent.

I didn't see a reason for the 100ms wait, and the test case for bug 460556 seemed to work fine with the asyncExec().

-------------------------------------
author: Karla Bray
date: 2015-05-29 15:55:25.000000000

Patch Set 2: Verified-1

With this 2nd patch, the dynamic contribution set in the sample project is called twice while it was called only once with the first patch.  

So I would say that it fails even if it is better than the initial code which was called dozens of times.

I can not comment the code fix.

-------------------------------------
author: Brenden Conley
date: 2015-05-29 15:56:29.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/5826/ : SUCCESS

-------------------------------------
author: Teagan Marsh
date: 2015-05-29 17:33:02.000000000

Patch Set 2:

Olivier — so that means the timer is required.

-------------------------------------
author: Jayvion Booth
date: 2015-05-29 17:53:43.000000000

Patch Set 2:

(3 comments)

Please see comments in the code.

Line:106, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java -> This might be paranoia, but I would prefer LinkedHashSet here and in the timerExec() copy codebelow. The reason is to maintain predictable and reproducible update order.

Line:1162, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java -> The code is not thread safe. Adding managers, checking for the collection size can colide with clearing the collecton, creating copy can collide with adding to collection.
All this operations should be inside synchronized(mgrsToUpdate) blocks.

Line:1168, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java -> If I undrestood it right, we want display.timerExec(X) here. X can be 50 - 100 ms. I probably would prefer smaller values.

-------------------------------------
author: Teagan Marsh
date: 2015-05-29 19:15:38.000000000

Patch Set 2:

So the reason there's only a single fill call with Dirk's executor approach: there's an "org.eclipse.swt.SWTException: Invalid thread access" thrown that is silently suppressed by the executor.  So the updates are a null-op.

-------------------------------------
