Opened 10 years ago
Closed 9 years ago
#11929 closed defect (fixed)
Low JOSM performance when mapillary layer is active with large sequence
Reported by: | wiktorn | Owned by: | nokutu |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin mapillary | Version: | latest |
Keywords: | performance | Cc: |
Description
When I download larger area and work with Mapillary layer I observe lower performance of scrolling/panning and drawing. After short profiling session I observed a lot of calls to:
MapillaryImage.equals(...)
I identified following source of this calls:
*while painting the layer there is iteration over sequences. But MapillarySequence.next(...)
calls ArrayList.contains(...)
, which is O(n), as well as ArrayList.indexOf(...)
, which is also O(n), and in the end - calls MapillaryImage.equals(...)
* n (length of sequence)
My guess is, that if you'd have constant-time MapillaryAbstractImage.next(...)
this would improve performance dramatically.
Attachments (1)
Change History (4)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Keywords: | performance added |
---|
comment:3 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've changed the ArrayList by Sets created by using:
Set<Foo> set = Collections.newSetFromMap(new ConcurrentHashMap<Foo, Boolean>);
Therefore, performance with big sets should be significantly improved.
I see... Then I'll try to improve it. I don't have much time at the moment so I will probably do this and a couple of other bugfixes during christmas holidays.
Thanks