[PostGIS] #3587: lwgeom_mindistance2d slows down topology loading
PostGIS
trac at osgeo.org
Fri Mar 8 01:28:39 PST 2024
#3587: lwgeom_mindistance2d slows down topology loading
-----------------------+-----------------------------
Reporter: strk | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS Fund Me
Component: topology | Version: 2.2.x
Resolution: | Keywords: performance
-----------------------+-----------------------------
Comment (by strk):
These are the timings of various approaches with the new performance
testcase "concentric circles" (adding lines forming concentric circles
with 128 segments per quadrant each):
{{{
TopoGeo_addLinestring_concentricCircles.log.main
Time: 31703.711 ms (00:31.704)
Time: 31486.980 ms (00:31.487)
Time: 31618.496 ms (00:31.618)
TopoGeo_addLinestring_concentricCircles.log.topo-addline-dwithin
Time: 6832.686 ms (00:06.833)
Time: 6729.710 ms (00:06.730)
Time: 6724.133 ms (00:06.724)
TopoGeo_addLinestring_concentricCircles.log.topo-addline-
geosdistanceindexed
Time: 4084.981 ms (00:04.085)
Time: 4071.703 ms (00:04.072)
Time: 4082.751 ms (00:04.083)
}}}
It looks like GEOSDistanceIndexed is the best choice as it doesn't change
semantic of the code, is the fastest in this case and is available in all
supported versions of GEOS.
The timings of the simple case of full coverage are not affected:
{{{
TopoGeo_addLinestring.log.main
Time: 44484.710 ms (00:44.485)
Time: 44450.532 ms (00:44.451)
TopoGeo_addLinestring.log.topo-addline-dwithin
Time: 44568.118 ms (00:44.568)
Time: 44238.656 ms (00:44.239)
TopoGeo_addLinestring.log.topo-addline-geosdistanceindexed
Time: 44405.012 ms (00:44.405)
Time: 44752.527 ms (00:44.753)
}}}
So the winner is: https://git.osgeo.org/gitea/postgis/postgis/pulls/182
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3587#comment:53>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list