Community
Participate
Working Groups
Created attachment 272898 [details] Sample project to reproduce the issue Steps to reproduce: 1. Import the attached project. 2. Open the session. 3. Create a new diagram on the root EPackage. This is fast, the diagram is initially almost empty with only an helper to initialize it. 4. Double-click on the helper to populate the diagram: it is very, very long: more than 3 minutes on my (fast) machine. Profiling shows that 67% of the time is spent in EdgeLayoutUpdaterModelChangeTrigger, which has two methods using O(N^2) algorithms: both isRefreshEdgeLayoutNeededForNotification and otherNotificationsAreConsequences are called once for each of the N changes in the transaction, and both methods get passed the full list of changes to iterate over.
New Gerrit change created: https://git.eclipse.org/r/119214
A first commit simply store Edge and Node, previously computed from a Notification, into two maps to avoid recompute it too many times. The time passed in EdgeLayoutUpdaterModelChangeTrigger | | before | with fix | | time in ELUMCT | 153s | 52s | TOTAL time | 214s | 99s | % time ELUMCT | 72% | 53%
So the time spent in EdgeLayoutUpdaterModelChangeTrigger has been divided by 3 but the global time has decreased of 25% only
New Gerrit change created: https://git.eclipse.org/r/119244
A new gerrit change Created (enhanced fix) : https://git.eclipse.org/r/#/c/119244/ The time passed in EdgeLayoutUpdaterModelChangeTrigger | | before | with basic fix | with enhanced fix | time in ELUMCT | 153s | 52s | 50ms | TOTAL time | 214s | 99s | 71s | % time ELUMCT | 72% | 53% | 0% The algorithm has been change from O(n2) to O(n) and the View corresponding to Notification are computing once each. This awesome result may seem supspect but I checked that we effectivel create 4012 CenterEdgeEndModelChangeOperation as before the changes.
Gerrit change https://git.eclipse.org/r/119214 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=9a5fba73a4b4c1cf22babaaf382b3fd4a0b31957
Gerrit change https://git.eclipse.org/r/119244 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=74b6cbfcd53c50cb6aa1c8e99efef3529697729a
Technical issue: no validation required
It took around 80s to create and layout the diagram.
Available in Sirius 6.0.0, see https://wiki.eclipse.org/Sirius/6.0.0 for details