Compile Ecorehttps://www.eclipse.org/forums/index.php/mv/msg/296445/804459/#msg_804459
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?

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!]]>Ed Willink2012-02-22T17:39:34-00:00