[geos-devel] Benchmark between various geometry libraries

Maxime van Noppen maxime at altribe.org
Thu Nov 19 11:16:53 EST 2009


strk wrote:
> I occasionally did rounds of such cleanups, but I think more time is spent
> in copying read-only coordinates for the sake of memory management
> while the JTS counterpart passes pointers around and delegates memory management
> to the garbage collector.

Indeed there are not that much containers heap-allocated. Though some
might be in performance sensitive areas (AbstractNode ? BufferBuilder ?).

> ~/dev/geos/trunk $ grep 'new std' `find . -iname '*.cpp'`
> ./capi/geos_ts_c.cpp:        std::vector<Geometry*>* vgeoms = new std::vector<Geometry*>(geoms, geoms + ngeoms);
> ./capi/geos_ts_c.cpp:        std::vector<Geometry*> *polyvec = new std::vector<Geometry *>(polys->size());
> ./capi/geos_ts_c.cpp:        std::vector<Geometry*> *linevec = new std::vector<Geometry *>(lines->size());
> ./capi/geos_ts_c.cpp:        std::vector<Geometry *>*geoms = new std::vector<Geometry *>(lines->size());
> ./capi/geos_ts_c.cpp:        std::vector<Geometry *> *vholes = new std::vector<Geometry *>(holes, holes + nholes);
> ./tests/unit/geom/CoordinateListTest.cpp:               std::auto_ptr< std::vector<Coordinate> > col( new std::vector<Coordinate>() );
> ./tests/unit/geom/CoordinateArraySequenceTest.cpp:              std::vector<Coordinate>* col = new std::vector<Coordinate>();
> ./tests/unit/geom/CoordinateArraySequenceTest.cpp:              std::vector<Coordinate>* col = new std::vector<Coordinate>();
> ./tests/unit/geom/CoordinateArraySequenceTest.cpp:              std::vector<Coordinate>* col = new std::vector<Coordinate>();
> ./tests/unit/geom/CoordinateArraySequenceTest.cpp:              std::vector<Coordinate>* col = new std::vector<Coordinate>();
> ./tests/unit/geom/GeometryFactoryTest.cpp:              std::vector<GeometryPtr>* vec = new std::vector<GeometryPtr>();
> ./tests/unit/geom/GeometryFactoryTest.cpp:              std::vector<GeometryPtr>* vec = new std::vector<GeometryPtr>();
> ./tests/unit/geom/GeometryFactoryTest.cpp:              std::vector<GeometryPtr>* lines = new std::vector<GeometryPtr>();
> ./tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp:                       std::vector<Coordinate>* col = new std::vector<Coordinate>();
> ./tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp:                       std::vector<Coordinate>* col = new std::vector<Coordinate>();
> ./tests/xmltester/XMLTester.cpp:                        std::vector<geom::Geometry *>*newgeoms = new std::vector<geom::Geometry *>;
> ./tests/xmltester/XMLTester.cpp:                        std::vector<geom::Geometry *>*newgeoms = new std::vector<geom::Geometry *>(lines->begin(),
> ./source/index/strtree/AbstractNode.cpp:        childBoundables=new std::vector<Boundable*>();
> ./source/operation/polygonize/PolygonizeGraph.cpp:                              intNodes=new std::vector<Node*>();
> ./source/operation/polygonize/PolygonizeGraph.cpp:      std::vector<EdgeRing*> *edgeRingList=new std::vector<EdgeRing*>();
> ./source/operation/polygonize/PolygonizeGraph.cpp:      std::vector<PolygonizeDirectedEdge*> *edgeRingStarts=new std::vector<PolygonizeDirectedEdge*>();
> ./source/operation/polygonize/PolygonizeGraph.cpp:      std::vector<const LineString*> *cutLines=new std::vector<const LineString*>();
> ./source/operation/polygonize/PolygonizeGraph.cpp:      std::vector<DirectedEdge*> *edges=new std::vector<DirectedEdge*>();
> ./source/operation/polygonize/PolygonizeGraph.cpp:      std::vector<const LineString*> *dangleLines=new std::vector<const LineString*>();
> ./source/operation/buffer/BufferBuilder.cpp:      new std::vector< Geometry * >();
> ./source/operation/buffer/BufferBuilder.cpp:   std::vector< Geometry* >* mergedLinesGeom = new std::vector< Geometry* >();
> ./source/operation/valid/ConnectedInteriorTester.cpp:   std::vector<EdgeRing*> *edgeRings=new std::vector<EdgeRing*>();
> ./source/geomgraph/DirectedEdgeStar.cpp:        resultAreaEdgeList=new std::vector<DirectedEdge*>();
> ./source/noding/MCIndexSegmentSetMutualIntersector.cpp::        monoChains( new std::vector<index::chain::MonotoneChain *>()),
> ./source/planargraph/Node.cpp:  std::vector<Edge*>* commonEdges = new std::vector<Edge*>();

-- 
Maxime


More information about the geos-devel mailing list