2007/9/11, Chris Holmes <[EMAIL PROTECTED]>:
>
> Do you have some benchmarks online anywhere?


To give you an idea, I set up a regression test with a dataset of 5000
random features in the unitsquare, put these in a MemoryDataStore and ran
150 queries (queries are such that one query is in the neighbourhood of the
previous one). Query window size is between 1/20 and 1/100 of the
unitsquare.
In the worst case (the cache needs to query the source datastore and load
new data in its storage), the overhead is on average +300 ms/query compared
to MemoryDataStore.
The mean query execution time difference is about 40 ms in favor of the
cache, as it uses indexation.

There are however some limitations :
. I only implemented a grid index, which is likely to be suboptimal in many
cases. Quadtree or rtree index would do better, but there is not much work
to do to adapt the cache on these.
. the cache stores features on a per feature type basis. It actually extends
FeatureSource rather than DataStore, but it would be easy to wrap a number
of cache instances around a DataStore to create a cached DataStore.
. current implementation is read-only, though it should be easy to make it
write-thru.

Also, do you have a sense of how easy this might be to include in
> GeoServer?  We use the datastore api directly, with the SPI mechanism to
> make things plug-ins.  But I imagine yours would be a bit different
> since it probably depends on another datastore that it's caching?  Or
> maybe I'm totally misunderstanding your work.  It sounds like the ideal
> would be to have a button in our UI that lets you wrap any of the
> normally configured datastores with a caching one.



I think a sample code will do for a demonstration :

int feature_type_index = 0;
int number_of_nodes = 500;
int cache_feature_capacity = 1000;
DataStore ds = ... ; // get any instance of a datastore
FeatureCache cache = new GridFeatureCache(
                    ds.getFeatureSource(ds.getTypeNames
()[feature_type_index]),
                    number_of_nodes,
                    cache_feature_capacity,
                    BufferedDiskStorage.createInstance());
// cache may be used anywhere you would normally use FeatureSource

I hope this somehow answers your questions.

cheers,

Christophe
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to