﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
13250	[Patch] JOSM seems to hang after sorting members of a complex relation	GerdP	team	"Select a multipolygon relation with > 6000 members, e.g. 6040654
Edit the relation
Click on the sort members icon

After a short time (maybe 4 seconds) all members are marked as changed but
JOSM doesn't respond for minutes (no idea how long it will take)

The time is consumed in a loop that invokes 
boolean org.openstreetmap.josm.gui.util.HighlightHelper.highlightOnly(Collection<? extends OsmPrimitive> prims)
with an Arraylist, and for this List the contains() method is called.

If I got that right, this is repeated for each member, and the list is growing with each member,
so after some iterations you have a sequential search on thousands of elements, repeated for thousands of times.
Using a Hashset instead of an ArrayList improves performance heavily, but maybe the problem
could be solved better elsewhere. Attached is a patch that shows where to use the HashSet.
"	enhancement	closed	normal	16.07	Core		fixed	Performance Relation Editor	
