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
The class JavaGrammarInformationProvider contains two methods ("getSyntaxElementID" and "getSyntaxElementByID") called quite often during parsing.
They use reflection to always look up an id or object in the same set of static and final fields within the JavaGrammarInformationProvider.
This can be considerably reduced by using a statically initialized cache for this limited set of values.
The JavaGrammarInformationProvider is an EMFText generated class located in
/org.emftext.language.java.resource.java/src-gen/org/emftext/language/java/resource/java/grammar/JavaGrammarInformationProvider.java
I did not figure out yet how to commit the requried change through a pull request. So please find below the required code changes for a cache using Java native LinkedHashMaps. An alternative would be a cache e.g. based on Google Guava, but this would require an additional dependency for the o.e.l.java.resource.java plugin.
I managed to make a fork and pull request for the change. However, referencing this original issue (#11) created an additional one (#12). Sorry for messing up the issue list.
The class JavaGrammarInformationProvider contains two methods ("getSyntaxElementID" and "getSyntaxElementByID") called quite often during parsing.
They use reflection to always look up an id or object in the same set of static and final fields within the JavaGrammarInformationProvider.
This can be considerably reduced by using a statically initialized cache for this limited set of values.
The JavaGrammarInformationProvider is an EMFText generated class located in
/org.emftext.language.java.resource.java/src-gen/org/emftext/language/java/resource/java/grammar/JavaGrammarInformationProvider.java
I did not figure out yet how to commit the requried change through a pull request. So please find below the required code changes for a cache using Java native LinkedHashMaps. An alternative would be a cache e.g. based on Google Guava, but this would require an additional dependency for the o.e.l.java.resource.java plugin.
Original Code
Modified Version using local caches
The text was updated successfully, but these errors were encountered: