On 8/2/11 17:16 , Falko Bräutigam wrote:
If we could get the Query API to return Values instead of Entities, I
think things like that could be way way more efficient.

Hmm... honestly I don't get the idea. I have to learn more about that.
Any pointers for me to read?

If you are doing a Query just to show some data in a UI, why load the data as Entities instead of just as Values? Apart from all the overhead with Entities compared to Values, it would also be possible to generate some of the data to be used in Values. You said you used computed properties, for example. That could be done in the Query, perhaps.

Wow! But how to implement an efficient cache if SoftReference is evil
then???

Major YES. I used SoftReferences, found out the hard way in production that this causes weird OutOfMemory issues, and then the JRockit folks told me to stay away. Major voodoo going on to support SoftReferences, so not recommended.

Manual LRU? Ok, great. But when to check/run it??? Are there
differences between Weak and SoftReferences in this regard?

For caching purposes Weak references are not that interesting. Basically, if a LRU cache was to be used in the UoW, then upon loading an entity and the cache is "full", then find last accessed one, which is not modified, and evict it.

/Rickard

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

Reply via email to