Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Compile Ecore
Compile Ecore [message #804459] Wed, 22 February 2012 11:47 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 458
Registered: June 2011
Senior Member
Hi,

i am creating Ecore model programatically and also instantiating it many times to create models.

I have experienced that setting delegates can be slow as they are not thread safe. So i wonder can i compile Ecore programatically and use compiled version so when i instantiate it to create model then performance gets better and it takes less time?

Cheers!
Re: Compile Ecore [message #804495 is a reply to message #804459] Wed, 22 February 2012 12:39 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi

Slow and thread safe are different issues.

Juno has a direct OCL to Java compiler that seems to get a lot of things
right but I have some nagging doubts to resolve about some type expressions.

So if you're happy with experimental code download Eclipse 3/8M5 or
4.2M5 and then install OCL 4.0.0M5.

Benchmarks so far show that the code executes two to fives faster
despite doing accurate polymorphic dispatch with greater arithmetic
precision. Once I'm happy that it works, an analysis of final calls
should allow further substantial speedups. Of course compilation occurs
at compile time so there are only Java JIT overheads for a first execution.

The new code has not been considered from a thread safety perspective.
Most of it is all simple stack access, so I suspect that if you make
sure that you use a distinct MetaModelManager per thread (inefficient)
or warm up a shared MetaModelManager to have all relevant type
specialisations you're probably alright. You can probably create a
derived MetaModelManager that synchronizes critical meta-model evolution
methods.

Regards

Ed Willink


On 22/02/2012 16:47, ModelGeek Mising name wrote:
> Hi,
>
> i am creating Ecore model programatically and also instantiating it
> many times to create models.
>
> I have experienced that setting delegates can be slow as they are not
> thread safe. So i wonder can i compile Ecore programatically and use
> compiled version so when i instantiate it to create model then
> performance gets better and it takes less time?
>
> Cheers!
Previous Topic:Implicit collect() flattening and OCLInEcore expression rewrite
Next Topic:Null pointer exception problem with OCL parsing
Goto Forum:
  


Current Time: Sun Apr 20 18:10:47 EDT 2014

Powered by FUDForum. Page generated in 0.05561 seconds