Replace geometry: poor performance with long ways
What steps will reproduce the problem?
- Select a new way with lots of nodes (say 500+)
- Replace an old way with the new way (CTRL+SHIFT+G)
What is the expected result?
After a few seconds the way is replaced
What happens instead?
JOSM becomes unresponsive for either several minutes, or freezes indefintely
URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-10-03 21:43:00 +0200 (Tue, 03 Oct 2017)
Build-Date:2017-10-03 19:50:21
Revision:12921
Relative:URL: ^/trunk
Identification: JOSM/1.5 (12921 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1703 (15063)
Memory Usage: 801 MB / 1797 MB (370 MB allocated, but free)
Java version: 1.8.0_141-b15, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=E:\Box Sync\Desktop\josm.jnlp, -Djnlpx.remove=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.splashport=55861, -Djnlpx.jvm=<java.home>\bin\javaw.exe]
Plugins:
+ FastDraw (33583)
+ ImportImagePlugin (33563)
+ Mapillary (v1.5.7)
+ PicLayer (33385)
+ apache-commons (33668)
+ apache-http (32699)
+ buildings_tools (33004)
+ ejml (32680)
+ ext_tools (33698)
+ geojson (55)
+ geotools (33380)
+ jogl (1.1.0)
+ jts (32699)
+ kendzi3d-resources (0.0.1)
+ log4j (32699)
+ opendata (33617)
+ reverter (33572)
+ utilsplugin2 (33677)
Last errors/warnings:
- W: Failed to delete outdated plugin '<josm.pref>\plugins\opendata.jar'.
- W: Failed to install already downloaded plugin 'opendata'. Skipping installation. JOSM is still going to load the old plugin version.
- W: Failed to delete outdated plugin '<josm.pref>\plugins\utilsplugin2.jar'.
- W: Failed to install already downloaded plugin 'utilsplugin2'. Skipping installation. JOSM is still going to load the old plugin version.
- W: Cannot lock cache directory. Will not use disk cache
- W: No configuration settings found. Using hardcoded default values for all pools.
- W: Cannot start IPv4 remotecontrol server on port 8111: Address already in use: JVM_Bind
- W: Cannot start IPv6 remotecontrol server on port 8111: Address already in use: JVM_Bind
- W: Cannot start IPv4 remotecontrol https server on port 8112: Address already in use: JVM_Bind
- W: Cannot start IPv6 remotecontrol https server on port 8112: Address already in use: JVM_Bind
Change History
(7)
Keywords: |
performance added
|
Description: |
modified (diff)
|
Summary: |
UtilsPlugin2: replace geometry tool causes freeze or very long waiting times for objects with many nodes → Replace geometry: poor performance with long ways
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Performance problem comes from use by default of an algorithm operating in
O(n^3 log(n))
. Your way appears to be 1135 nodes, so it implies1135^3*log(1135) ~= 4 billion
operations, which is... a lot of time.A less precise but faster implementation exists, it should be used for ways larger than a certain size (to be determined).