DESCRIPTION

Bug 514277 - Performance of closing parts/windows (with many visibleWhen/enabledWhen) is very slow

Change-Id: If5d40a3d51825fbc803da2faeac3fa1b71b6e96f


COMMENTS

author: Mariela Flores
date: 2017-03-27 19:33:17.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2017-03-27 19:33:23.000000000

Patch Set 1:

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

-------------------------------------
author: Mariela Flores
date: 2017-03-27 19:39:40.000000000

Patch Set 1: Code-Review-2 Verified-1

This patch set is NOT meant to be merged into the codebase

-------------------------------------
author: Brenden Conley
date: 2017-03-27 19:58:45.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Rayan Moreno
date: 2017-03-28 08:40:11.000000000

Patch Set 1:

(2 comments)

I think there are some race conditions in this code. The optimizations may then be better or worse from what you've observed.

Line:546, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AbstractContributionItem.java -> should be volatile as it is read and written from different threads

Line:70, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> Better use a ConcurrentHashMap and call ConcurrentMap.computeIfAbsent()

-------------------------------------
author: Mariela Flores
date: 2017-03-28 08:45:53.000000000

Patch Set 1:

Well in reality this code is not called from different threads but only from the UI-Thread.

I guess one could remove the synchronize all together.


 > (2 comments)
 > 
 > I think there are some race conditions in this code. The
 > optimizations may then be better or worse from what you've
 > observed.

-------------------------------------
author: Mariela Flores
date: 2017-03-28 08:52:05.000000000

Patch Set 1:

(2 comments)

Line:546, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AbstractContributionItem.java -> You are right to be extra safe we should make this volatile or an atomic reference - but as stated in reality this code is only called from one thread the UI-Thread otherwise any other code following later in the call chain would fail miserably

Line:70, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> Heinz Kabutz one of the Java concurrency heros advises to NEVER use computeIfAbsent on a ConcurrentHashMap and I don't think in the use case shown here it would help at all

-------------------------------------
author: Rayan Moreno
date: 2017-03-28 10:02:42.000000000

Patch Set 1:

(2 comments)

Line:546, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AbstractContributionItem.java -> if this is the case, then the current == null branch is useless as well

Line:70, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> It is discouraged if you modify the map from within the computation function, but here, the removal happens in a asyncExec.

The behavior would be the same as your current code, but the throughput may be improved thanks to ConcurrentHashMap licking strategies.

-------------------------------------
author: Mariela Flores
date: 2017-04-03 19:27:01.000000000

Patch Set 2: Patch Set 1 was rebased

-------------------------------------
author: Gerrit Code Review
date: 2017-04-05 07:48:36.000000000

Change has been successfully merged into the git repository by Mariela Flores

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