[Patch] Node.toString() and Way.toString() causing performance problems
These methods are called heavily by
javax.swing.DefaultListCellRenderer.getListCellRendererComponent(JList, Object, int, boolean,boolean)
which is called by
org.openstreetmap.josm.gui.OsmPrimitivRenderer.getListCellRendererComponent(JList, OsmPrimitive, int, boolean, boolean)
When you load a dataset with many ways and nodes and press Strg+A to select all objects
or search for something that appers very often. Since these methods are rather complex,
the dialog reacts very slow.
If I got that right, the result of the toString()
is not even used in these cases.
I think it would be a good idea to not use DefaultListCellRenderer
here.
Change History (6)
Summary: |
Node.toString() and Way.toString() causing performance problems →
[Patch} Node.toString() and Way.toString() causing performance problems
|
Summary: |
[Patch} Node.toString() and Way.toString() causing performance problems →
[Patch] Node.toString() and Way.toString() causing performance problems
|
Keywords: |
performance added
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
The attached patch solves the problem. Since the value is not used we can pass a null value
so that toString() is not called.