Well,
added the cache, down to 40 seconds. Where are those 40 seconds
spent? Creating property accessors, and trying to convert a Double
to double/float going thru a String object!
Don't you believe me? See:
private float evalToFloat(Expression exp, Object f, float fallback){
if(exp == null){
return fallback;
}
try{
// TODO: change to this! return exp.evaluate(f,Float.class);
return Float.parseFloat(exp.evaluate(f).toString());
}
catch(NumberFormatException nfe){
return fallback;
}
}
whilst the property accessor creation does something like:
public PropertyAccessor createPropertyAccessor(Class type, String xpath,
Class target, Hints hints) {
if ( xpath == null )
return null;
if (!Feature.class.isAssignableFrom(type) &&
!FeatureType.class.isAssignableFrom(type))
return null; // we only work with simple feature
if ("".equals(xpath) && target == Geometry.class)
return DEFAULT_GEOMETRY_ACCESS;
//check for fid access
if (xpath.matches("@(\\w+:)?id"))
return FID_ACCESS;
//check for simple property acess
if (xpath.matches("(\\w+:)?(\\w+)") ) {
return ATTRIBUTE_ACCESS;
}
return null;
}
Pattern matching is expensive, and this property accessor creation
code is run in our innermost loop... I'll try to fix this one too,
but I'm wondering, what's the acceptable balance between performance
and flexibility? Our rendering performance, in 2.3.x, is not shiny
imho, but with changes like these, we're going to become slower
than the first dummy renderer we had 4 years ago...
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