Skip to content

Performance issues in org.eclipse.syson.sysml.impl.FeatureImpl.getType() #2131

@flatombe

Description

@flatombe

For larger models, expanding nodes in the Explorer view can take several seconds, making the UI very unpleasant to work with.

The issue seems to come from org.eclipse.syson.sysml.impl.FeatureImpl.getType(), which in one of our samples is called ~1400 times.

The following analysis is courtesy of Franz Ritter:
It calls TypeImpl#getOwnedSpecialization, which triggers ImplicitSpecializationSwitch. The switch calls specializesFromLibrary(), which resolves qualified names against the SysML standard library via TypeImpl#inheritedMemberships.
That computation recursively walks the entire supertype hierarchy (e.g., OccurrenceUsage → Usage → Feature → Type → Classifier → Anything), collecting all visible memberships at each level — including imported memberships from other library packages.
Since MembershipComputer is instantiated fresh per call with no cross-call caching, this full hierarchy traversal repeats for every single getType() invocation, costing ~25ms each.

I think it might be a good idea to add some caching on these types of operations.

PS: I don't think it's directly related, but may be of interest to #1102.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions