Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » ApplyStereotypes takes seconds at first time
ApplyStereotypes takes seconds at first time [message #908587] Wed, 05 September 2012 11:58 Go to next message
Tex Iano is currently offline Tex Iano
Messages: 99
Registered: February 2012
Member
Hi,

I have a web application where I programmatically create a UML model. Here I also apply stereotypes of a custom UML profile.

It works pretty well, however the first time, I apply a stereotype on a class within my model takes several seconds (high-end hardware). After the first time, the applyStereotype methods works pretty fast.

So now I am trying to debug, why this happens. Do you have any idea?

Regards,

Tex
Re: ApplyStereotypes takes seconds at first time [message #908602 is a reply to message #908587] Wed, 05 September 2012 12:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

Various factors may be contributing (from my limited knowledge)

In order to apply stereotypes, you may be triggering the load of many
additional Profile resources. (Instrumenting ResourceImpl constructions
can be quite enlightening/depressing.)

UML2 objects make extensive use of smart caches to handle rarely used
data lazily. You may be provoking a lot of cache population.

Stereotypes bridge the M1/M2 layers so there may be a significant M1+M2
configuration cost.

There may also be bugs in your code or the UML code causing quadratic or
worse behaviours.

Regards

Ed Willink


On 05/09/2012 16:58, Tex Iano wrote:
> Hi,
>
> I have a web application where I programmatically create a UML model.
> Here I also apply stereotypes of a custom UML profile.
>
> It works pretty well, however the first time, I apply a stereotype on
> a class within my model takes several seconds (high-end hardware).
> After the first time, the applyStereotype methods works pretty fast.
> So now I am trying to debug, why this happens. Do you have any idea?
> Regards,
>
> Tex
Re: ApplyStereotypes takes seconds at first time [message #908852 is a reply to message #908602] Thu, 06 September 2012 01:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

On 05/09/2012 17:17, Ed Willink wrote:
>
> Stereotypes bridge the M1/M2 layers so there may be a significant
> M1+M2 configuration cost.
See Christian Damus' comments in the "[CDO] Using ECrossReferenceAdapter
in CDO" thread on the EMF newsgroup
(news://new.eclipse.org:119/k28sa9$mi8$1@xxxxxxxxe.org).

Stereotypes use an ECrossReferenceAdapter so there may be a full model
analysis to find the back references.

Regards

Ed Willink
Re: ApplyStereotypes takes seconds at first time [message #909053 is a reply to message #908852] Thu, 06 September 2012 09:11 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. Damus
Messages: 768
Registered: July 2009
Senior Member
Hi, Ed, Tex,

There's also a considerable one-time cost of resolving a proxy
referencing the profile and then loading the UML metamodel and its
attendant library models and profiles, which adds up to quite a lot of
XML.

cW

On 2012-09-06 05:44:07 +0000, Ed Willink said:

> Hi
>
> On 05/09/2012 17:17, Ed Willink wrote:
>>
>> Stereotypes bridge the M1/M2 layers so there may be a significant M1+M2
>> configuration cost.
> See Christian Damus' comments in the "[CDO] Using
> ECrossReferenceAdapter in CDO" thread on the EMF newsgroup
> (news://new.eclipse.org:119/k28sa9$mi8$1@xxxxxxxxe.org).
>
> Stereotypes use an ECrossReferenceAdapter so there may be a full model
> analysis to find the back references.
>
> Regards
>
> Ed Willink
Re: ApplyStereotypes takes seconds at first time [message #909383 is a reply to message #908587] Fri, 07 September 2012 00:10 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
BTW, if you are using UML2 on a server application, read this:

http://abstratt.com/blog/2011/01/25/using-uml2-in-a-server-side-application-read-this/

In essence, by default UML2 is not usable in a server-side application as it requires a global lock to be thread safe.
Re: ApplyStereotypes takes seconds at first time [message #909493 is a reply to message #909383] Fri, 07 September 2012 04:31 Go to previous messageGo to next message
Tex Iano is currently offline Tex Iano
Messages: 99
Registered: February 2012
Member
Hi,

thanks for all your feedback. So obviously it is ok, when UML takes some time at the beginning to cache and reference elements etc.

However, Rafael: This is a important aspect for me I did not yet consider. Did not know that there are some issues to expect. Another very important sentence in the article you posted:

"On the not-so-great side, development seems to have stopped. IBM, which founded (and funded) the project, apparently pulled the plug last year. "

Development seems to have stopped? Did not have this impression. Is it true? Can't believe that because there are some more projects using UML2.

Regards,

Tex
UML support (was Re: ApplyStereotypes takes seconds at first time) [message #909502 is a reply to message #909493] Fri, 07 September 2012 04:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

MDT/UML2 development continues, perhaps in fits and starts.

IBM involvement may have stopped, but the Eclipse world moves on. New
supporters must be found. Firtunately some are coming forward. Thanks.

CEA List support a number of OMG-related technologies, such as 87% of
the recent commits to Papyrus.

You may notice CEA List copyright notices on the UML 2.4.1 support such
as http://wiki.eclipse.org/MDT/UML2/UML2_4.0_Migration_Guide.

Regards

Ed Willink


On 07/09/2012 09:31, Tex Iano wrote:
> Hi,
>
> thanks for all your feedback. So obviously it is ok, when UML takes
> some time at the beginning to cache and reference elements etc.
>
> However, Rafael: This is a important aspect for me I did not yet
> consider. Did not know that there are some issues to expect. Another
> very important sentence in the article you posted:
>
> "On the not-so-great side, development seems to have stopped. IBM,
> which founded (and funded) the project, apparently pulled the plug
> last year. "
>
> Development seems to have stopped? Did not have this impression. Is it
> true? Can't believe that because there are some more projects using UML2.
>
> Regards,
>
> Tex
Re: ApplyStereotypes takes seconds at first time [message #910221 is a reply to message #909493] Sat, 08 September 2012 22:33 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
That was not the point I wanted to direct you to, but back then it seemed the case. That is no longer my impression, and Ed's reply seems to confirm that. This list was pretty dead back then as well, with no one that actually knew UML2 around to answer questions or fix bugs. These days the list is quite lively, which gives me hope the project is still going strong enough (if not vibrant). The more frequent releases we have now are another positive sign of the project's health. I am still a happy user, the library does what I need quite well (and if you want close UML compliance, there is no alternative, really).

Cheers,

Rafael


Re: ApplyStereotypes takes seconds at first time [message #910223 is a reply to message #910221] Sat, 08 September 2012 22:38 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Also, keep in mind that it is now safe to use UML2 in server applications if you enable the per-thread cache (you still have to synchronize if you are sharing a model):

https://bugs.eclipse.org/bugs/show_bug.cgi?id=335125
Previous Topic:PrimitiveType
Next Topic:Acceleo only works the first time
Goto Forum:
  


Current Time: Thu Jul 31 21:55:33 EDT 2014

Powered by FUDForum. Page generated in 0.01991 seconds