code optimization [message #1758741] |
Sat, 01 April 2017 10:40  |
Eclipse User |
|
|
|
Hi,
The execution of the below code, takes a lot of time, Does anyone have a idea to optimize it?
if (MM_ETL!TransformationRule -> allInstances() -> exists (l|
l.source.resolvedType.elementName=MM_Src!EStructuralFeature.allInstances() -> select (s|s.name=a.target.collectAllContainedElements()->last().name)-> collect (s|s.eType.name)->first()
or
MM_Src!EClass.allInstances() -> select(s|s.eSuperTypes.includes((MM_Src!EStructuralFeature.allInstances() -> select (s|s.name=a.target.collectAllContainedElements()->last().name)-> collect (s|s.eType)->first())))-> select (s|s.name=l.source.resolvedType.elementName))->notEmpty()
))
I also write it in the below form, but it also takes about 5 minutes.
if (MM_ETL!TransformationRule -> allInstances() -> exists (l|
(MM_Src!EClass.allInstances() -> select(s|s.eSuperTypes.includes((MM_Src!EStructuralFeature.allInstances() -> select (s|s.name=a.target.collectAllContainedElements()->last().name)->first().eType)))-> collect (s|s.name))
.append(MM_Src!EStructuralFeature.allInstances() -> select (s|s.name=a.target.collectAllContainedElements()->last().name)->first().eType.name).includes(l.source.resolvedType.elementName)
))
any comment is appreciated.
[Updated on: Sat, 01 April 2017 14:41] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06717 seconds