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
3 stars 1 forks source link

v.net.models: Speed up point attributes processing loop #57

Open benducke opened 1 week ago

benducke commented 1 week ago

Currently, v.net.models spends considerable time in an inner and outer loop construct following this message:

Transferring input point attributes to output lines (links):

There are some opportunities for optimization:

  1. There is one v.db.select call in the outer loop that could be replaced with db.execute.
  2. There is a call to grep in the inner(!) loop, which could be replaced with an internal list search function.
  3. There is potential for SQL chunk processing in the inner loop (see related issue: #56 ).
benducke commented 1 day ago

res=echo "${previous}" | "${GREP}" " ${cur} " -c # TODO: Check if replacing this with an internal list search function improves performance