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.sort: Implement speed-ups for SQL operations #58

Closed benducke closed 2 months ago

benducke commented 2 months ago

Currently v.sort spends most of its time in the loop construct following this message:

g.message -i "Sorting and updating ${num_records} records:"

There is an outer (rows) and inner (colums/fields) loop.

The inner loop...

for field in ${FIELDS} ; do
...
done

... holds almost all of the optimization potential:

  1. Build a statement chain to process all fields in one go (this makes the inner loop superfluous!).
    1. Make this a DELAYED SQL transaction in chunks (see: #56 )!
benducke commented 2 months ago

Solved in commit https://github.com/benducke/Network-reconstruction-tools-for-GRASS-GIS/commit/ead5adc82b4ad3681b6639248237c467922af60