Bug 452558 - Avoid 2 calls to representation refresh in precommit
Summary: Avoid 2 calls to representation refresh in precommit
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.0.0M4   Edit
Assignee: Esteban DUGUEPEROUX CLA
QA Contact: Maxime Porhel CLA
URL:
Whiteboard:
Keywords: performance, triaged
: 447594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-20 12:38 EST by Esteban DUGUEPEROUX CLA
Modified: 2015-06-24 11:13 EDT (History)
3 users (show)

See Also:


Attachments
Example to reproduce (3.36 KB, application/zip)
2014-11-20 12:38 EST, Esteban DUGUEPEROUX CLA
no flags Details
Second example with many more semantic content to measure performance. (27.03 KB, application/zip)
2014-11-21 05:49 EST, Esteban DUGUEPEROUX CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Esteban DUGUEPEROUX CLA 2014-11-20 12:38:50 EST
Created attachment 248799 [details]
Example to reproduce

Using the attached Modeling Example project :

1. Open the diagram
2. Set a breakpoint in RefreshEditorsPrecommitListener.localChangesAboutToCommit()
3. Delete "c2" and diagram refresh is called twice because we have a delete tool for c2 which remove only c2 remove removing the EReference.
Comment 1 Esteban DUGUEPEROUX CLA 2014-11-20 12:40:13 EST
The diagram refresh is called twice because we have the DanglingRefRemovalTrigger which is called and update the semantic model to clean the dangling reference EReference.eType which reference the deleted "c2".
Comment 2 Maxime Porhel CLA 2014-11-21 03:24:34 EST
The first refresh is done on the "cleaned" model. 
The second refresh is triggered dure to the "cleaning" notifications.

One possibility could be to avoid doing the refresh while the DanglingRefRemovalTrigger  cleans the model.
Comment 3 Esteban DUGUEPEROUX CLA 2014-11-21 04:08:45 EST
I have a first draft of fix : https://git.eclipse.org/r/36829
Comment 4 Esteban DUGUEPEROUX CLA 2014-11-21 05:49:38 EST
Created attachment 248812 [details]
Second example with many more semantic content to measure performance.

Using the attached example Test2.zip,

Do the same scenario :

without draft fix : 885 ms to have delete executed through DefaultOperationHistory.execute()
with the draft fix : 532 ms
Comment 5 Esteban DUGUEPEROUX CLA 2014-11-24 08:00:05 EST
*** Bug 447594 has been marked as a duplicate of this bug. ***
Comment 6 Esteban DUGUEPEROUX CLA 2014-11-28 02:59:46 EST
Fixed as da6e4fa79b6b13d8e07c47f72d72b8293ff4eda6 .
Comment 7 Belqassim Djafer CLA 2015-04-08 05:26:01 EDT
Verified on Sirius 3.0.0M6
Comment 8 Maxime Porhel CLA 2015-05-22 04:36:21 EDT
Validated on Sirius 3.0.0 RC1
Comment 9 Pierre-Charles David CLA 2015-06-24 11:13:30 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.