-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PackageNotFoundException is instanciated a lot and quite costly #36
Comments
pcdavid
added a commit
that referenced
this issue
Jun 4, 2024
Bug: #36 Signed-off-by: Pierre-Charles David <[email protected]>
sbegaudeau
pushed a commit
that referenced
this issue
Jun 5, 2024
Bug: #36 Signed-off-by: Pierre-Charles David <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
org.eclipse.sirius.emfjson.utils.GsonEObjectDeserializer.deserializeMultipleNonContainmentEReference
(among others) we try to resolve the resource part of a reference URI as an EPackage usinggetPackageForURI(String uriString)
.This works for the case where the reference URI is of the form e.g.
http://www.eclipse.org/emf/2002/Ecore#//EBoolean
, but will fail in most concrete cases where the reference URI will be something like52317c1f-0516-48b4-bad4-15a3a07aebe9#//path/to/some/element.1
. In such a casegetPackageForURI
keeps track of the error with:Unfortunately, the error type used,
PackageNotFoundException
is an actual Java exception, which is very costly to create (because offillStackTrace
). I'm not sure why thisResource.Diagnostic
(along with all the otherJsonException
subtypes) are exceptions, but just commenting out this line to avoid creating thousands of exceptions when loading a medium-sized model give a significant performance boost:Before (master, emf-json 2.3.9/master):
After (commented this.helper.getResource().getErrors().add(new PackageNotFoundException()))
Simply commenting out the code is probably too much, but replacing an exception with a plain
Resource.Diagnostic
object should get us most of the gain (I need to confirm).The text was updated successfully, but these errors were encountered: