Hi,

I thought so. However (there always is a however :)), entityNamed: is mostly used when you program queries with Moose.

The goal of the name cache in the group was actually to support that use case. But, it's true that if it costs too much to build the cache, it is not worth it in the end.

So, for this purpose maybe it makes sense to keep the performance optimization. To check the advantage, we should compare the penalty on the group creation time with and without the name cache.

Cheers,
Doru



On Wed, Sep 25, 2013 at 2:53 PM, Diego Lont <diego.lont@delware.nl> wrote:
Doru,

You were right we should add performance tests … so we ran some. And the only thing that has a significant speedup is the monticello import. We probably need to rewrite this not to use "entityNamed:" …

Importing whitestar (Delphi project using the Delphi importer) gives some interesting results:
Old version: ca. 12 min. 50
New version: ca. 12 min.
stripped version: ca. 10 min. 50.
That is: CPU-time pharo needed for loading + displaying the Moose model.

I guess that the new version improved performance comes from initializing the byName at the size of capacity instead of 10.000.

So, the question is now:
- should I commit this stripped version, where the byName is gone entirely and the elements are only calculated on demand.
(after I make the performance tweak to the Monticello Importer)
- should I revert the mooseName change (I guess I best leave out the privateState entirely to avoid confusion, since the old never caches anyway).

In the mean time I am running some more tests.

Cheers,
Diego

On Sep 25, 2013, at 12:05 PM, Diego Lont wrote:
- mooseName is now cached. This can have an impact if you rely on your model to be more dynamic. If you have a custom entity that can receive sub-entities at runtime, you might want to resetMooseName. For example, if you modify the scope of a FAMIXType, the mooseName has to be reset:

FAMIXType>>container: aContainerEntity
container := FMMultivalueLink on: self
update: #types
from: self container
to: aContainerEntity.
self resetMooseName

This is supposed to be an optimization, but it makes the code more complicated. To see if it is actually worth it, we should benchmark the impact.

@Diego, @Stephan: Did you do some benchmarking on this?


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
www.tudorgirba.com

"Every thing has its own flow"