Validator extremely slow if duplicates are selected
|Reported by:||bilbo||Owned by:||team|
How to reproduce:
1) Load attached file
2) Press "Validate"
3a) Single click "Errors/Duplicated ways (8796)" (so nothing will be selected)
4a) press "Fix" -> all duplicated ways gets fixed fast (like 5 seconds)
Now close the file and load and validate it again - repeat steps 1) and 2)
3b) Double click "Errors/Duplicated ways (8796)" (so all duplicated ways will be selected)
4b) press "Fix" -> Fixing will take ages (many minutes, possibly more than hour by guessing from the rate on the progressbar)
This happens with other validation types too (like fixing untagged unconnected nodes), though the result between "Selected" and "unselected" case is not so big (for untagged and unconnected nodes it is "only" about 2 times slower).
It seems that UndoRedoHandler.addNoRedraw in the second case somehow causes some events to be fired when the affected ways are selected (in profiler I saw lot of time spent in DatasetEventManager$1.run(), DatasetEventManager.fireEvents() and DatasetEventManager.fireConsolidatedEvents()) and way too much CPU time is spent in that cases.