[geos-devel] Benchmark between various geometry libraries

strk strk at keybit.net
Mon Nov 23 13:09:44 EST 2009


On Fri, Nov 20, 2009 at 06:42:53PM +0100, Maxime van Noppen wrote:

> I looked for any 'new std::something' but I just found there are 'using
> namespace std;' in the code, and therefore we should also look for 'new
> something'. I found 120 'new vector' out of 656 'new something' :

Yeah, I knew it :)

> > ./doc/example.cpp:297:  vector<Geometry *> *holes = new vector<Geometry *>;
> > ./tests/bigtest/bug234.cpp:17: vector< Geometry * > *polys1 = new vector<Geometry*>();

Examples and tests we don't care...

> > ./source/planargraph/NodeMap.cpp:70:    vector<Node*> *values=new vector<Node*>();

Fixed by http://trac.osgeo.org/geos/changeset/2724
 
> > ./source/geom/GeometryFactory.cpp:238:          CoordinateSequence *cl=coordinateListFactory->create(new vector<Coordinate>(1, coordinate));

This is a factory, it's meant to allocate things.
In the specific cases it create these vectors to transfer
their ownership to the Geometry objects it constructs.

> > ./source/geom/Geometry.cpp:567:         vector<Geometry *> *v = new vector<Geometry *>();

Same as above, allocated for ownership transfer.
Optimized allocations for elements by
http://trac.osgeo.org/geos/changeset/2734

Beside, this is not even used by the C-API ...

Well, a lot of these are likely unused places after all so I stop here :)

I think the correct way to proceed if we want to make GEOS any faster
would be understanding what's making it slow in the first place.

The Area() timing is interesting because it's obvious where the difference
between GEOS and GGL is : coordinates access.

--strk;

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 


More information about the geos-devel mailing list