Jesse Eichar ha scritto:
> Hi,
> 
> I want to make some optimizations to some of the Spatial Filters so  
> that we can get some significant (10-20x) performance improvements.   
> However the implementations are all read/write.  I have three options  
> and I wanted feedback on how others thought I should proceed.
> 
> 1.  Make the spatial filters read only so I don't have to worry about  
> it anymore.  We can discuss how to do this at a later date
> 2.  Make a parallel implementation of the filters that are readonly.
> 3.  Tough it out and add these optimizations to the read/write filters
> 
> The reason this is an issue is because the strategy involves caching  
> some information (like prepared geometries).  It is pretty trivial if  
> the objects are read-only and I can do the calculation at setup.  But  
> if they are read/write then I have to worry about how to re-create the  
> cached information.
> 
> The other side is that if I make things readonly then I have to be  
> able to figure out what objects use the read/write behaviour and  
> update them.  That is where the parallel set of filters comes in.  I  
> can have a hint so that a different filter factory is created that  
> returns read-only objects.

Hard decision. Making an API read only means helping who's coding
them, and eventually get crazy whoever is in need to manage/partially 
update them (go try modify a geoapi style and you'll see what I
mean).

Is it really that much work to have in your code a structure like:

PreparedGeometry pgeom;
PreparedGeometry getPrepared() {
   if(pgeom == null) {
     // build prepared
   }
   return pgeom;
}

public void setWhatever(Param a, Param b, ...) {
   pgeom = null;
   // rest of the code
}

Cheers
Andrea

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

------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to