On 8/2/11 01:34 , Falko Bräutigam wrote:
Say displaying a list of spatial features as the result of an query
(maybe a bounding box) in a GIS app. The user selects the rectangle of
the bbox, the result gets displayed in a table. The user then sorts the
table for one column, picks an entity, opens an editor...

If we could get the Query API to return Values instead of Entities, I think things like that could be way way more efficient.

Unfortunatelly sorting in the backend is not an option because most
properties are computed. So IFAIS I need to fetch all entities to sort
them. Just a few entities are used afterwards to display the visible
lines of the table. Almost all entities are probably never used again.
The cool thing with the soft references is that, *if* the user makes
some more selection and/or sorting, then all this is very fast as long
as there is enough memory to hold all the entities.

SoftReferences are evil. They *sound* good on JavaDoc, but in practice they bite back because of how they impact the GC. A manual LRU is better, it turns out. All JVM people I've talked to say to avoid SoftReferences, and it's been my experience as well.

/Rickard

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

Reply via email to