[geos-devel] JTS/GEOS performance

Martin Davis mbdavis at VividSolutions.com
Wed Feb 2 13:05:31 EST 2005


> That's a virtual call, so cannot be statically bound.
> A simple coordlist[4] on the other hand is usually inlined. 
> (C++ gurus correct me if I'm wrong)

Good point.  But surely this alone can't account for the difference
between GEOS and JTS?  I doubt Java is doing much "inlining" either.

> Geometry#getCoordinates() returns Coordinate[], not
CoordinateSequence. 

I know, that's my point.  The JTS codebase should be using
getCoordinateSequence almost exclusively.

> assumption of a "fast" implementation has always been in JTS, 
> see the toInternalCoordinate() method.

Yes, but I'm trying to move JTS away from assuming this.

> Nope. GEOS actually dropped CoordinateArrays and 
> CoordinateList classes merging all into CoordinateSequence. 

That's unfortunate - these 3 classes have very different uses.

> Note that for DefaultCoordinateSequence, 
> the #toVector() method doesn't involve any copy.

Well that removes one possible source of unecessary memory allocation.
Can you think of anywhere else where memory allocation might be
happening that could be removed?

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046




More information about the geos-devel mailing list