Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 512444

Summary: EditModeDecorator checks the semantic element lockStatus and the part broken state twice
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: DiagramAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact: Laurent Redor <laurent.redor>
Severity: normal    
Priority: P3 CC: laurent.redor, pierre-charles.david
Version: 3.1.0Keywords: triaged
Target Milestone: 3.1.8   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/91521
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2265166392f2857b0a89e857b82f34261711df5b
https://git.eclipse.org/r/93498
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=06e5976837363087e6cbf9a9483ae79949a82852
Whiteboard:
Bug Depends on: 512292    
Bug Blocks: 512443    
Attachments:
Description Flags
Test.zip none

Description Maxime Porhel CLA 2017-02-20 10:54:52 EST
+++ This bug was initially created as a clone of Bug #512292 +++

Steps to reproduce: 
 - launch a runtime
 - open a diagram
 - put a breakpoint in EditModeDecorator.shouldBeDecorated
 - put a breakpoint in EditModeDecorator.getDecorationImage
 - Check the calls to getPermissionAuthority(), getLockStatus(), eResource()

In several context, on a big diagram, those operations can be costly and we do them twice for each concerned edit part during decorator refresh. 

One lead would be to only check the state of the part in shouldBeDecorated and to do the complex stuff in getDecorationImage as we need to identify which image we want to return.
Comment 1 Eclipse Genie CLA 2017-02-21 03:10:43 EST
New Gerrit change created: https://git.eclipse.org/r/91521
Comment 3 Laurent Redor CLA 2017-03-20 07:41:22 EDT
Created attachment 267353 [details]
Test.zip

Steps used to validate:
* Import project "Test" from Test.zip
* Open diagram "new diag" from "Test" project and then close it
* Start CPU Profiling in yourkit with tracing enabled
* Compare number calls to getPermissionAuthority(), getLockStatus() and eResource(), with a previous version (it must be smaller)
Comment 4 Eclipse Genie CLA 2017-03-21 07:22:41 EDT
New Gerrit change created: https://git.eclipse.org/r/93498
Comment 5 Maxime Porhel CLA 2017-03-21 07:23:54 EDT
See new patch set which reset the previous decoration image computation priority.
Comment 7 Laurent Redor CLA 2017-03-22 11:46:41 EDT
Validated with scenario of bug 512433 comment 6
Comment 8 Pierre-Charles David CLA 2017-04-12 04:58:34 EDT
Available in Sirius 3.1.8, see https://wiki.eclipse.org/Sirius/3.1.8 for details.