Hi all,
as you may have noticed, a user recently pointed out very poor
performance while rendering 100000 points, something as slow
as 200 seconds. I can confirm the order of magnitude of the
issue, and happily, that's something trunk specific.

A quick profile on only 2500 points shows that PropertyAccessors
is the problem.
The issue is, SLD uses attributes, and 
AttributeExpressionImpl.evaluate(xxx) calls this code snippet in
PropertyAccessors.java

Iterator factories = FactoryRegistry.lookupProviders( 
PropertyAccessorFactory.class );
while( factories.hasNext() ) {
        PropertyAccessorFactory factory = (PropertyAccessorFactory) 
factories.next();
        PropertyAccessor accessor = factory.createPropertyAccessor( 
object.getClass(), xpath, target, hints );
        if ( accessor != null && accessor.canHandle( object, xpath, target ) ){
                return accessor;
        }
}               
return null;

now, going thru the SPI registry this way is _very_ expensive,
lookup should be cached and reused. Unfortunately, that
accessor.canHandle(...) makes it impossible to build a cache
that goes from class -> accessor, and this is really bad, since
during rendering this code is executed in the innermost loop.

I'm going to fix this quickly adding at least a lookup cache
that should fix the biggest part of the problem,
but the canHandle(xxx) should be imho removed or mitigated as well too. 
What do we do if we can to handle 30 different types of property 
accesses, loop over 30 candidates each time we need to access a 
property? As an alternative to removal, AttributeExpressionImpl may try 
to ask for the property accessor just once, and cache it locally,
this would probably give us a balance between flexibility and
acceptable performance.

Cheers
Andrea

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to