Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trac #728 Delaunay triangulation performance problem #55

Closed
wants to merge 1 commit into from

Conversation

dbaston
Copy link
Member

@dbaston dbaston commented Nov 21, 2015

As described in postgis/postgis#73

@strk
Copy link
Member

strk commented Nov 21, 2015

interesting enough, there's no testcase triggering a call to that removal method!

@strk
Copy link
Member

strk commented Nov 21, 2015

Taking it back, the method is called. From the testsuite only once and finds 12 edges.
Better review how many such calls the class may get. To run (and improve) the test:
./geos_unit geos::triangulate::Delaunay

Reviewing internal usage of that container would be another approach, as I'm pretty sure .size() is being called far more than needed.

@dbaston
Copy link
Member Author

dbaston commented Nov 21, 2015

From looking on the JTS side, I don't think QuadEdgeSubdivision::remove method is ever called from within the library - it would only ever be accessed if a user is manipulating their own QuadEdgeSubdivision, which would be a fringe use case. Even the comments in JTS (which were copied to GEOS) indicate the performance of the remove method is unimportant:

https://github.com/metteo/jts/blob/master/jts-core/src/main/java/com/vividsolutions/jts/triangulate/quadedge/QuadEdgeSubdivision.java#L230

I think switching the container type is a simple solution that will bring a 10x - 100x performance increase for the core use cases of GEOSDelaunayTriangles and GEOSVoronoiDiagram. It also better matches the JTS implementation, which uses an ArrayList instead of a LinkedList.

@strk
Copy link
Member

strk commented Nov 21, 2015 via email

strk pushed a commit that referenced this pull request Nov 21, 2015
Patch by Daniel Baston via
#55

git-svn-id: http://svn.osgeo.org/geos/trunk@4119 5242fede-7e19-0410-aef8-94bd7d2200fb
@dbaston
Copy link
Member Author

dbaston commented Nov 21, 2015

Thanks! Can this be applied to the 3.5 branch? It would be nice to get the benefit for ST_Voronoi in PostGIS.

@strk
Copy link
Member

strk commented Nov 21, 2015 via email

strk pushed a commit that referenced this pull request Nov 21, 2015
Patch by Daniel Baston via
#55

git-svn-id: http://svn.osgeo.org/geos/branches/3.5@4120 5242fede-7e19-0410-aef8-94bd7d2200fb
@dbaston dbaston closed this Nov 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants