Community
Participate
Working Groups
Build Identifier: 20091217-0918 In the org.eclipse.m2m.internal.qvt.oml.ast.env.ModelParameterExtent class in the getContents() method the allRootObjects variable is set as an ArrayList which causes significant performance issues for the section of code: for (EObject obj : inMemoryResource.getContents()) { // don't forget about UML stereotype applications which are the root objects if (obj.eContainer() == null && allRootObjects.contains(obj) == false) { allRootObjects.add(obj); } } when the number of root objects increases to several hundred thousand. The contains method in ArrayList does not scale well, so it may be better to have these collections be HashSets (or similar) so that this comparison can be done quickly when the number of objects produced is in the order of several hundred thousand. This may cause issues for object ordering, which doesn't affect my transform however. Reproducible: Always
Created attachment 171853 [details] Changes the getContents() method of ModelParameterExtent to use HashSets
Created attachment 228860 [details] Updated version of patch For testing the following transformation was used: modeltype Ecore uses ecore('http://www.eclipse.org/emf/2002/Ecore'); transformation NewTransformation1(in input : Ecore, out output : Ecore); main() { var index := 0; while (index < 100000) { object EClass {name := "n" + index.toString()}; index := index + 1; } } With the proposed patch execution time of method EvaluationUtil.createEvaluationResult() reduced from 4054ms to 86ms.
Pushed to master for Kepler M7. Commit ID: f29c4a7c64cc0133dd1abb45a547eae8244dc498