Hi,

The current MapEntityStore and DefaultEntityStore uses a strategy which basically loads the JSON-state on read, and parses it out completely, and then writes it out completely on UoW complete. Since usecases normally only needs a small portion of the properties/associations there's a lot of unnecessary parsing going on, both ways.

So I made a new version of it which instead reads the JSON-object from the underlying store and then provides that directly to the EntityState. When a property is read, only then is it parsed from the JSON-object. Similarly, when a property is set, at that point it is translated into JSON, so that UoW-complete basically only writes the already up-to-date JSON-object. This *should* be faster and consume a whole lot less memory.

However, when I did performance profiling I could see that the performance difference was quite small. The reason is that parsing the JSON-object from a String is what really takes time. The main difference, then, would be memory footprint, which is important enough.

I've kept the old MapEntityStore mixin around, but have switched to the new JSONMapEntityStoreMixin for the memory store. If other stores want to use it, just replace the mixin that is used.

/Rickard

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

Reply via email to