Hi,
I will try to answer to questions from both performance
issues threads. While the CSS Engine makes some (often unnecessary)
brute-force refreshes in diagrams, this is not the main cause of
performance degradation. The reason why SysML 1.4 is especially affected
is because it uses sub-packages (rather than sub-profiles), and last
time I checked [1], Eclipse/UML2 didn't optimize the performances for this
scenario. The reason is that Sub-packages in profiles have been
introduced with UML 2.4, whereas the API to retrieve a Definition from a
Profile is much older (And it retrieves a Definition from a *Profile*,
not from a *Package*).
So if you look at the results from a
profiling tool (deep enough, i.e. deeper than what is displayed in the
screenshot here), you will probably find "UMLUtil.getStereotype(EObject)".
This method uses several strategies to retrieve the Profile <->
EPackage matching (Using static definitions, dynamic definitions,
extension points... and ultimately, when everything else fails,
iterating on the entire resource set contents)
This method
doesn't expect the scenario where an Ecore EPackage corresponds to a UML
Package, simply because this wasn't possible until UML 2.4 (And most
profiles in Papyrus are still using nested *profiles*, so they are not
affected)
Fixing this method in Eclipse/UML2 should solve your performance issues
Regarding the CSS Engine itself, creating an element may affect the style of another element. For example:
Class[ownedAttributes~=id] { /* A class containing a property named "id" will be displayed in red */
fontColor: red;
}
If
you create a new property named "ID" in this class, then the class'
figure needs to be refreshed (Even if the creation happens in the
semantic model)
There are some ways to optimize the performances
of the CSS Engine (To reduce the cost of interpreting Matchers, and to
do fine-grain refresh, without actually breaking any feature), but they
require rewriting a good part of the engine. This was scheduled along
with the support of CSS3, but this work has never been completed.
Anyway,
improving UMLUtil to support Package Definitions (UML Packages
containing Stereotypes) should be a better candidate for fixing SysML
1.4 performance issues
[1] I didn't verify whether
https://bugs.eclipse.org/bugs/show_bug.cgi?id=497359 fixed or improved this issue
Regards,
Camille