On Sun, Oct 3, 2010 at 10:45 AM, Rickard Öberg <[email protected]> wrote:

> The way I see it there are two options:
> 1) Cache on MapEntityStore. The Reader might come from cache. This gives
> copy on an reads though.

Done this now... At least having a baseline solution.

> 2) Cache in EntityState and coordinate through MapEntityStoreMixin. This
> puts caching outside of the underlying MapEntityStore, and provides
> possibility for copy-on-write.
>
> If possible, 2) looks very tempting. I have noticed in performance tests
> that the JSONObject.read() operations is VERY costly (comparatively), so
> getting away from that would be nice.

As I said previously, caching the EnityState with copy-on-write is a
much more complex undertaking, as there are many locations where the
EntityState are held. I agree we should look into this later, BUT I
think this time is not the moment to try and get copy-on-write done
and wait with the whole thing post-1.2

Likely is that the EntityState references needs to include an
additional indirection level, so the EntityState instance can be
replaced in one spot, AND ensure that nothing caches the values
elsewhere.


WDYT?

Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to