Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL too slow when transforming
icon9.gif  ATL too slow when transforming [message #799000] Wed, 15 February 2012 05:18 Go to next message
Marc Gil is currently offline Marc Gil
Messages: 189
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi!

Firstly, I know that the question i'm going to do is so relative about how you implement ATL rules... But I think I have done a lot of improvements to try to decrease the time that ATL takes in transformations, like using mappings, cache variables, "using" block...

I have a transformation from UML2 to JPA that really does two transformations:
- UML 2 Javagen: M2M transformation using ATL. (Javagen is an owned metamodel used to annotate the UML elements to be transformed to Java)
- {UML, Javagen} 2 JPA: M2T transformation using XPand.

We also have a Configuration model used in the ATL transformation, where we configure every UML element.

Well, I have done several tests with different UML models of different size (increasing the number of classes), and the ATL transformation obviously takes more time as the number of UML elements is increasing, cause I have several conditionals (if...else) in the rules.

But, with an UML model that "only" has 55 classes with several attributes and associations, the ATL transformation takes a lot of time. Concretely more than 1 hour!!! It's incredible...

This transformation is included into an application that is used by a lot of users, and obviously it's not useful...

I'm using the ATL Compiler 2006 version with Eclipse Galileo 3.5.0.

I don't know if new ATL Compiler 2010 version could work with Eclipse Galileo 3.5.0 or 3.5.2, and I don't know if this compiler could make my transformations quicklier...

Any idea about how to decrease the time that spends ATL in transformations?
Re: ATL too slow when transforming [message #799023 is a reply to message #799000] Wed, 15 February 2012 05:45 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 147
Registered: July 2009
Senior Member
On 15/02/12 11:18, Marc wrote:
> Hi!
>
> Firstly, I know that the question i'm going to do is so relative about how you
> implement ATL rules... But I think I have done a lot of improvements to try to
> decrease the time that ATL takes in transformations, like using mappings,
> cache variables, "using" block...
>
> I have a transformation from UML2 to JPA that really does two transformations:
> - UML 2 Javagen: M2M transformation using ATL. (Javagen is an owned metamodel
> used to annotate the UML elements to be transformed to Java)
> - {UML, Javagen} 2 JPA: M2T transformation using XPand.
>
> We also have a Configuration model used in the ATL transformation, where we
> configure every UML element.
>
> Well, I have done several tests with different UML models of different size
> (increasing the number of classes), and the ATL transformation obviously takes
> more time as the number of UML elements is increasing, cause I have several
> conditionals (if...else) in the rules.
>
> But, with an UML model that "only" has 55 classes with several attributes and
> associations, the ATL transformation takes a lot of time. Concretely more than
> 1 hour!!! It's incredible...

That is indeed a ridiculously long time; I'd expect something in the order of
minutes, if the input model is large (> 1000 classes), especially because the
transformation logic is limited to simple mapping.

As your setup includes lots of tools (EMF, ATL, UML2, Javagen, XPand), the
performance bottleneck could be elsewhere than in ATL. Have you already run
the whole thing in a Java profiler, such as VisualVM?

If ATL turns out to be the cuplrit, a profiler log could be really useful for
the ATL developers.

>
> This transformation is included into an application that is used by a lot of
> users, and obviously it's not useful...
>
> I'm using the ATL Compiler 2006 version with Eclipse Galileo 3.5.0.
>
> I don't know if new ATL Compiler 2010 version could work with Eclipse Galileo
> 3.5.0 or 3.5.2, and I don't know if this compiler could make my
> transformations quicklier...

As far as I know, the ATL 2010 compiler is not available for Eclipse 3.5. If
you want to use the latest ATL developments, you should really consider
upgrading to Eclipse 3.7.

That said, the ATL 2010 compiler focuses on optimised refining mode
transformation. If you're not using refining mode, there is likely no
difference with 2006.

>
> Any idea about how to decrease the time that spends ATL in transformations?

If you're using large models (e.g. > 1000 UML classes), the time spent in EMF
model loading and saving can run into minutes rather than seconds. Caching
models will help in that case, but mind the available heap space!

If you'd like feedback on your specific ATL transformation, please attach your
ATL file, or even entire Eclipse project..

Cheers,
Dennis
Re: ATL too slow when transforming [message #799709 is a reply to message #799023] Thu, 16 February 2012 03:06 Go to previous messageGo to next message
Marc Gil is currently offline Marc Gil
Messages: 189
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi Dennis!

About using a Java Profiler... I used sometimes TPTP to know some bottlenecks in the app. But I always used it in a second instance of Eclipse. If I tried the mentioned transformation in a RCP and it took 1 hour, imagine how it can take in a second instance and using the TPTP profiler... It could take several years to finish it Very Happy

I think that the main problem is that we're using a configuration model, where we configure every UML element (for instance, every class has 7 configurable patterns, properties has 9 and associations 1). If my UML model has 55 classes, 356 properties and 48 associations, the result is 385 class patterns to check, 3637 property patterns and 48 association patterns.

So then in ATL we need to check for every element all of their pattern, checking every rule of the pattern... there could take a lot of time. But 1 hour... is a lot of time. For this reason I wonder if 2010 ATL compiler version has improved something about time spent in transformations...

Maybe another problem I have found is that we have a lot of called ruled and only a few amount of matching rules... I think this could be an important bottlenecks in ATL, isn't it?

Maybe we need to check the transformation, and maybe remove some of these patterns...

Thanks again!

[Updated on: Thu, 16 February 2012 03:14]

Report message to a moderator

Re: ATL too slow when transforming [message #801002 is a reply to message #799709] Fri, 17 February 2012 15:04 Go to previous message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 147
Registered: July 2009
Senior Member
On 16/02/12 09:06, Marc wrote:
> Hi Dennis!
>
> About using a Java Profiler... I used sometimes TPTP to know some bottlenecks
> in the app. But I always used it in a second instance of Eclipse. If I tried
> the mentioned transformation in a RCP and it took 1 hour, imagine how it can
> take in a second instance and using the TPTP profiler... It could take several
> years to finish it :d

I no longer use TPTP: it was discontinued in Eclipse 3.7. VisualVM is a good
alternative, and connects directly to any JVM, not just a second runtime
instance of Eclipse. Also: it's free.

>
> I think that the main problem is that we're using a configuration model, where
> we configure every UML element (for instance, every class has 7 configurable
> patterns, properties has 9 and associations 1). If my UML model has 55
> classes, 356 properties and 48 associations, the result is 385 class patterns
> to check, 3637 property patterns and 48 association patterns.
>
> So then in ATL we need to check for every element all of their pattern,
> checking every rule of the pattern... there could take a lot of time. But 1
> hour... is a lot of time. For this reason I wonder if 2010 ATL compiler
> version has improved something about time spent in transformations...
>
> Maybe we need to check the transformation, and maybe remove some of these
> patterns...
>
> Thanks again!

I really cannot say anything on this unless I see some of the ATL code, sorry.

Regards,
Dennis
Previous Topic:[ATL] Global map for caching elements
Next Topic:[ATL]Guard condition at target element in matched rule
Goto Forum:
  


Current Time: Sat Apr 19 03:09:12 EDT 2014

Powered by FUDForum. Page generated in 0.10356 seconds