Opened 10 years ago
Last modified 12 months ago
#5641 new defect
Painting error layer is very slow
Reported by: | bilbo | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core validator | Version: | latest |
Keywords: | performance gsoc-candidate | Cc: | michael2402 |
Description (last modified by )
When error layer in validator is visible and being painted, scrolling through the map is very slow - with medium size map (~ 8000 ways, 32000 nodes), when I zoom in close, the scrolling is smooth, however if I turn on the error layer, the scrolling goes to about 1 redraw per 2 seconds.
I suspect that the error layer is not using quad buckets or any similar algorithm to speed things up and only draw things that are actually visible.
Although, even when zoomed out (so entire map is visible), the redraw speed is much worse (approximately 3 to 5 times slower with the error layer than without it)
Attachments (2)
Change History (8)
comment:1 Changed 10 years ago by
Priority: | major → normal |
---|
comment:2 Changed 8 years ago by
Component: | Core → Core validator |
---|---|
Description: | modified (diff) |
comment:3 Changed 7 years ago by
Keywords: | performance added |
---|
comment:4 Changed 2 years ago by
Keywords: | gsoc-candidate added |
---|
Changed 17 months ago by
Attachment: | patch.diff added |
---|
Changed 17 months ago by
comment:5 Changed 17 months ago by
Cc: | michael2402 added |
---|
@Michael: I tried to rework the validation layer painting but I failed to get any improvement.
What I saw using my sample data set (work.osm) with information level enabled (more than 1000 error items) and displaying the full view:
- painting OSM data layer alone takes about 50ms
- painting validator layer alone takes about 50ms
- painting both layers takes:
- about 50 ms for the OSM data layer
- then about 300 ms for the validator layer! most of the time is spent in Graphics.drawArc methods but I don't understand why it is slower if the OSM data layer has been previously painted. Any clue?
I tried to change a lot of things, including dropping the direct Java2D rendering to use MapViewPath. The resulting code is simpler, but not faster.
Do you see how to improve the situation?
comment:6 Changed 17 months ago by
@Don-vip
It could be some setting that the layer sets for the graphics instance.
You could try:
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
Hopefully, [5671] did improve this situation.