Martin Desruisseaux ha scritto:
> Andrea Aime a écrit :
>>> Well, regarding the caching itself, our current approach (which is now 
>>> still only implemented in a different project in C++) is to cache the 
>>> original geometries (not the decimated ones) in blocks of data according 
>>> to a spatially indexed tree constructed only once on first access for 
>>> each layer/FeatureSource. (...snip...)
>> Wow, this seems excellent design and quite widespread in applicability.
> 
> Actually the old J2D renderer (which is the basis for Johan's one) was already
> doing that, minus the RTree (which I would like to add in the new renderer) 
> and
> the lazy loading (the hook was there, but we didn't made the final step). The
> cache of decimated geometries was only one step further after the above.

> The fact that J2D-renderer was keeping the full (non-decimated) geometries in
> memory was one of the main issues reported against it. We didn't implemented 
> the
> disposal of oldest geometries like the above C++ implementation, but this is
> something that could be added. I agree that it is important.

It's not only that. At the time I thought you were asking me to perform
caching and dropping on a feature by feature basis, something like:
- use a weak reference for the geometry
- the jvm drops it when there is memory pressure
- you reload it using the feature id when you need to draw it again

This is a performance nightmare since you usually have to pay a
significant price to start accessing features, no matter if you access
1 or 100. Think network access for example.

The very good thing about Milton design is not only the disposal of 
oldest geoemtries, but the fact it is done in blocks, that mitigates
a lot the latency issue above and makes disposing and reloading
actually useful in practice.

Another bit is a policy/design against cache
thrashing, when the ratio between what you need to draw and
what you can cache is so unfavourable that the cache hit ratio
drops to zero. A block based design + memory index seems to be
quite resilient to thrashing thought.

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to