﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23097	[PATCH] Significantly reduce allocations during startup in XmlObjectParser and PluginListParser	taylor.smock	team	"With the Name Suggestion Index preset added to JOSM, the following methods are relatively expensive during startup (mem old -> mem new, cpu old -> cpu new):
* `XmlObjectParser$Entry.getField` (124 MB -> 8.1 MB, 501ms -> 99ms)
* `XmlObjectParser$Entry.getMethod` (126 MB -> 452 kB, 292ms -> 45ms)

The gains are almost entirely from getting rid of copy calls to Method and Field (done when calling `Class.getMethods()` and `Class.getFields()`). There are further gains in JVM methods (like GC), but those can be a bit ticklish to profile correctly. It does look like a 20% improvement there though (32,653ms -> 26,075ms).

Note: I'm also including a change in `PluginListParser` to avoid compiling a pattern over and over again. That reduces the cost of `PluginListParser.parse` from 25.5 mb to 12.1 mb and 217ms to 162ms. Most of the remaining cost is stuff we cannot do anything about.

Additional note: The PluginListParser numbers included the cost of interning the strings. I ended up removing that since code analysis indicated that the strings were not kept long-term."	defect	closed	normal	23.08	Core		fixed	performance startup	
