BasicEList.contains(EObject)
method. This is due to the fact that the corresponding
EReferences
have the unique
flag set to true
. EMF makes sure each element appears only once in the list of that reference. This is good, but performs poor for big growing lists.As I construct the model from scratch I can make sure there will be no duplicates. So instead of
parent.getFeature().add(child);
I cast to
BasicEList
and call((BasicEList<EObject>) parent.getFeature()).addUnique(child);
In my case, that reduced the execution time to a fifth !