benducke / Network-reconstruction-tools-for-GRASS-GIS

Node-based network model generator for GRASS GIS 7.x (and QGIS 3.x)
GNU General Public License v3.0
4 stars 1 forks source link

v.points.thin: Improve speed of feature editing operations #59

Closed benducke closed 1 month ago

benducke commented 2 months ago

The script does all of its heavy duty processing within its main loop construct:

while [ ${STOP} -lt 1 ] ; do ... done

The biggest CPU time consumers here are the calls to v.extract, v.edit and db.execute. It should be possible to gain a large speed-ups by executing these in chunks instead of per-feature. A related ticket is this: #56

benducke commented 1 month ago

SQL statement collation ("chunks") is not a good idea, since the v.edit operations to delete features and the SQL operations needed to delete attribute table rows must be exactly synchronized.

Instead, SQL transaction blocks have been used to gain a little speed:

https://github.com/benducke/Network-reconstruction-tools-for-GRASS-GIS/commit/e63214b3e90dabce20611ef789b87c05090f98f6