You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
Rename refactoring performance is very poor, specially in big projects.
I had a look at the code and found basically two bottlenecks
(1) RefactoringCrossReferenceSerializer.getCrossRefText(EObject, CrossReference, EObject, RefTextEvaluator, ITextRegion, StatusWrapper) calls IScope.getElements(EObject)
(2) this basically maps to DirtyStateAwareResourceDescriptions.getExportedObjectsByType(EClass) and from there to AbstractCompoundSelectable.getExportedObjectsByType(EClass) with ResourceDescriptionsData as instance which then calls EObjectDescriptionLookUp.getExportedObjectsByType(EClass) which iterates over allDescriptions
=> we do a LOT of iterating
(3) during that iterating EObjectDescriptionImpl.getEObjectURI() is called a lot so we are affected by the appendFragment.trimfragment calculation in uri. i wonder if we could introduce there a cache like
private URI normalizedURI;
@Override
protected void eBasicSetContainer(InternalEObject newContainer) {
normalizedURI = null;
super.eBasicSetContainer(newContainer);
}
@Override
public URI getEObjectURI() {
if (normalizedURI != null) {
return normalizedURI;
}
EObject container = eContainer();
if (container instanceof IResourceDescription) {
URI result = ((IResourceDescription) container).getURI().appendFragment(getFragment());
normalizedURI = result;
return result;
}
return null;
}
...
public void setFragment(String newFragment) {
normalizedURI = null;
(+ adaption of setFragment)
The text was updated successfully, but these errors were encountered:
@cdietrich do you have an "rough" idea where the poor performance is coming from? I assume it is somehow related to the recording of changes within org.eclipse.xtext.ide.serializer.impl.ChangeSerializer.beginRecordChanges(Resource). What is again the reason for recoding the entire AST with node models?
Rename refactoring performance is very poor, specially in big projects.
I had a look at the code and found basically two bottlenecks
(1)
RefactoringCrossReferenceSerializer.getCrossRefText(EObject, CrossReference, EObject, RefTextEvaluator, ITextRegion, StatusWrapper)
callsIScope.getElements(EObject)
(2) this basically maps to
DirtyStateAwareResourceDescriptions.getExportedObjectsByType(EClass)
and from there toAbstractCompoundSelectable.getExportedObjectsByType(EClass)
withResourceDescriptionsData
as instance which then callsEObjectDescriptionLookUp.getExportedObjectsByType(EClass)
which iterates overallDescriptions
=> we do a LOT of iterating
(3) during that iterating
EObjectDescriptionImpl.getEObjectURI()
is called a lot so we are affected by the appendFragment.trimfragment calculation in uri. i wonder if we could introduce there a cache like(+ adaption of setFragment)
The text was updated successfully, but these errors were encountered: