| Summary: | Improve RefreshLayoutCommand | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Laurent Redor <laurent.redor> | ||||||||
| Component: | Diagram | Assignee: | Laurent Redor <laurent.redor> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||
| Severity: | enhancement | ||||||||||
| Priority: | P3 | CC: | mickael.lanoe, pierre-charles.david | ||||||||
| Version: | unspecified | Keywords: | triaged | ||||||||
| Target Milestone: | 2.0.4 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 458973 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Laurent Redor
Created attachment 249990 [details]
SequenceProject.zip (for steps to reproduce)
Created attachment 249993 [details]
Initial state - First snapshot screenshot
A first snapshot, with the current state (on branch 2.0.x), shows that:
* 20% of the time is passed in SequenceDiagram.getAllLifelines (532 calls)
* 18% of the time is passed in SequenceDiagram.getAllOperands (532 calls)
* look at Sirius-InitialState.snapshot.png to have more details
For the previous (comment 2) analysis, there are 2 solutions: * Reduce the number of calls to these methods * Add a cache for method getAll* from SequenceDiagram. Indeed, the values returned by these methods can certainly be cache during the layout. Created attachment 249995 [details] Snapshot with cache capability With a cache capability, gerrit https://git.eclipse.org/r/#/c/39746/1, the previous problems, comment 2, are solved. 0% of the time is used for SequenceDiagram.getAllLifelines and SequenceDiagram.getAllOperands. This gerrit is in DRAFT mode because it can still change based on future analyzes. After the cache: * we can observe that DDiagramElementImpl.getDiagramElementMapping() is called 18582 times and cost 2% of times. * we can observe that getVerticalRange() is called often ** Message.getVerticalRange(): 12%, 527 calls ** SequenceMessageViewQuery..getVerticalRange(): 11%, 527 calls ** SequenceNodeQuery.getVerticalRange(): 9%, 2005 calls ** Operand.getVerticalRange(): 2%, 625 calls ** Execution.getVerticalRange(): 1%, 252 calls Sometimes in code there are 2 calls to this method. Only one is necessary if we use a local variable. With these optimisations, https://git.eclipse.org/r/#/c/39747/1 and https://git.eclipse.org/r/#/c/39748/1: * we can observe that DDiagramElementImpl.getDiagramElementMapping() is called 9268 times and cost 1% of times. * we can not observe real change on getVerticalRange() With analysis, I observe that in ParentOperandFinder.getParentOperand(Range), there is a possible optimisation. In a AND predicate, the second predicate is less costly that the first one. This is the gerrit https://git.eclipse.org/r/#/c/39749/1. Before this gerrit, there are 76 calls to ParentOperandFinder.getParentOperand(Range) and it costs 10%. After, same number of calls, but it costs 9% Several improvments have been commited: * [1] : Corresponds to comment 4 * [2] & [3] : Corresponds to comment 5 * [4] : Corresponds to comment 6 [1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?h=v2.0.x&id=9211b37ab242747dd461fdff9783118c14352c3c [2] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?h=v2.0.x&id=7e115ca26ca2ada4f6e298cb627b066189a533b1 [3] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?h=v2.0.x&id=77b493e64da3eab35c36daab9092b5702fee1457 [4] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?h=v2.0.x&id=5f0d5e70add735c07022db7a3ac0c934a408c5d0 Another improvement has been commited to reduce the calls to event ends computation : http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?h=v2.0.x&id=c0abae26590c2df71d3c5ce038447dedb010f1d8 All enhancements are considered as sufficient. Validated Validated by Mickael. Available in Sirius 2.0.4. |