﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
16938	[Patch] Poor GUI performance when data contains ways with many nodes	GerdP	team	"==== What steps will reproduce the problem?
1. Load sample file which is an extract of coastlines
2. execute a search for (type:way ""natural""=""coastline"" -closed)
3. Zoom in/out or pan close to ways with many nodes, e.g. way 409381644

==== What is the expected result?
Quick reaction 
==== What happens instead?
Sometimes GUI hangs for many seconds before reacting
==== Please provide any additional information below. Attach a screenshot if possible.
I noticed that while trying to find errors in the coastline. I used VisualVM to track down where the problem occurs. It always showed NavigatableComponent.getNearestWaySegments().
I think I found one problem addressed by the attached small patch:
The searchloop should only search for the 2 nodes in the current way segment, not for all nodes of the way.
{{{
Build-Date:2018-11-02 08:35:18
Revision:14401
Is-Local-Build:true

Identification: JOSM/1.5 (14401 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1803 (17134)
Memory Usage: 2579 MB / 3641 MB (1434 MB allocated, but free)
Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:55052, -ea, -Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (34535)
+ apache-commons (34506)
+ buildings_tools (34572)
+ download_along (34503)
+ ejml (34389)
+ geotools (34513)
+ jaxb (34506)
+ jts (34524)
+ measurement (34529)
+ merge-overlap (34664)
+ o5m (34405)
+ opendata (34698)
+ pbf (34576)
+ poly (34546)
+ reverter (34552)
+ undelete (34568)
+ utilsplugin2 (34506)

Last errors/warnings:
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: Unable to delete archived backup file <josm.pref>\autosave\deleted_layers\63240038.osm.pbf_20181102_081222383.osm
- W: Unsaved changes - <html>The relation has been changed.<br><br>Do you want to save your changes?</html>
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<The maximum bbox size is 0.25, and your request was too large. Either request a smaller area, or use planet.osm>
- E: Bad Request - org.openstreetmap.josm.gui.widgets.HtmlPanel[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm>
- E: Bad Request - org.openstreetmap.josm.gui.widgets.HtmlPanel[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm>
- E: Bad Request - org.openstreetmap.josm.gui.widgets.HtmlPanel[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
}}}
"	defect	closed	normal	18.11	Core		fixed	template_report performance	
