Opened 12 years ago

Last modified 2 years 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 skyper)

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)

patch.diff (20.8 KB) - added by Don-vip 3 years ago.
work.osm (3.1 MB) - added by Don-vip 3 years ago.

Change History (8)

comment:1 Changed 12 years ago by bastiK

Priority: majornormal

comment:2 Changed 10 years ago by skyper

Component: CoreCore validator
Description: modified (diff)

Hopefully, [5671] did improve this situation.

comment:3 Changed 9 years ago by Don-vip

Keywords: performance added

comment:4 Changed 4 years ago by Don-vip

Keywords: gsoc-candidate added

Changed 3 years ago by Don-vip

Attachment: patch.diff added

Changed 3 years ago by Don-vip

Attachment: work.osm added

comment:5 Changed 3 years ago by Don-vip

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 3 years ago by michael2402


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);
Last edited 2 years ago by Don-vip (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to bilbo
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.