Modify

Opened 3 months ago

Last modified 4 weeks ago

#16128 new defect

Viewport movement and zooming is terribly slow

Reported by: jengelh@… Owned by: team
Priority: normal Milestone:
Component: Core mappaint Version:
Keywords: performance regression Cc: bastiK, stoecker, michael2402

Description

Between r7000 and r10526, the draw operation for JOSM nodes and ways went significantly worse to the point of unusability. Java 8 (and later) also play a role, as running 10526 with java7 brings back at least some of the performance.

This seems to concern mostly viewport actions, such as scrolling and zooming the map with the right mouse button/scrollwheel. Moving, for example, a node or polygon around while keeping the viewport unchanged still has acceptable performance.

Since there are no .jar files between 7000 and 10526 on the download server anymore, I cannot narrow it down, and building revisions between that with ant also fails in many ways indistinguishable from magic.

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-07-11 23:04:49 +0200 (Mon, 11 Jul 2016)
Build-Date:2016-07-12 01:31:48
Revision:10526
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10526 en) Linux openSUSE Leap 15.0 Beta
Memory Usage: 273 MB / 1730 MB (189 MB allocated, but free)
Java version: 1.8.0_161-b12, Oracle Corporation, OpenJDK 64-Bit Server VM

Attachments (3)

16128-disable-text-when-moving.patch (6.1 KB) - added by Don-vip 2 months ago.
02.gif (12.5 MB) - added by Klumbumbus 2 months ago.
03.gif (17.3 MB) - added by Klumbumbus 2 months ago.

Change History (27)

comment:1 Changed 3 months ago by jengelh@…

A screen capture (external camera because josm ought not to share CPU with a screenrecorder too) - http://inai.de/files/16128.mkv (bbox={51.5375538,51.5399828,9.8185874,9.8214769})

comment:2 Changed 3 months ago by stoecker

All versions are available. Old ones are in Archiv directory.

comment:3 Changed 3 months ago by anonymous

Meanwhile, I have found that wire mode does not suffer from the performance issues. Through further experimentation, it drills down to the "text:" directive in mapcss files. Removing "text:auto" everywhere restores the performance.
I will try the archives.

comment:4 Changed 3 months ago by jengelh@…

Last good one: 7380
First bad one: 7391

comment:5 Changed 3 months ago by Don-vip

Component: CoreCore mappaint
Keywords: performance added

comment:6 Changed 3 months ago by Don-vip

Cc: bastiK added
Keywords: regression added

@bastiK: it seems to be a regression from r7382:7390, can you please take a look?

comment:7 Changed 3 months ago by bastiK

I would say it is not a bug but a feature: This is when we introduced more sophisticated label rendering, i.e. text halo for place nodes and text running along the highway. Naturally there is a cost in performance, but I haven't seen it that drastic.

@jengelh: Do you have a fast computer, what kind of CPU?

comment:8 Changed 3 months ago by jengelh@…

i7-4600U and i5-8250U are the models I have so that is by no means underpowered. Before, I had a Atom N450 and even that ran the then-current version (just around r7200-r7300) good enough. I don't really think I need halo rendering, how could I disable it?

comment:9 Changed 3 months ago by Klumbumbus

jengelh, please download this old version of the internal style (download at the bottom: raw format) and try in your current setup (josm 10526 or later and Java 8) if this improves the performance significant. (of cause disable the current internal style during the test)

Last edited 3 months ago by Klumbumbus (previous) (diff)

comment:10 Changed 3 months ago by jengelh@…

Yes, using that revision of the stylesheet in place of the built-in one makes moving the viewport a lot more usable, both with Java 8 and 10 (can't spot a performance difference between the two JRE versions).

comment:11 in reply to:  8 Changed 3 months ago by bastiK

Replying to jengelh@…:

i7-4600U and i5-8250U are the models I have so that is by no means underpowered. Before, I had a Atom N450 and even that ran the then-current version (just around r7200-r7300) good enough. I don't really think I need halo rendering, how could I disable it?

It is not normal that it takes 1 second to render 10 letters and it would be nice to find the cause for this.

Do you get the extremely slow rendering on both machines independently? If so, the trigger of this problem is bound to be some hardware / software / configuration preference on your side. A possible explanation, that comes to mind is that Java tries to delegate the rendering to the graphics card, but the result is a complete failure.

comment:12 in reply to:  10 Changed 3 months ago by Klumbumbus

I too had expected that it is rather caused by rendering code or hardware/software configuration. (I can't find such a massive change in the style code itself in r7380:7391) But if using older versions of the style make a difference for you, can you narrow it down to a specific change of the style by testing different old versions with your current JOSM?

comment:13 Changed 3 months ago by jengelh@…

can you narrow it down to a specific change of the style

yes, the "text:" tag(s) in mapcss, as mentioned earlier in the report.

Changed 2 months ago by Don-vip

comment:14 Changed 2 months ago by Don-vip

Cc: stoecker michael2402 added

We can disable text rendering while moving the map (see patch). It seems to improve drastically the performances without really affecting the rendering: we're not really able to read the text while moving the map. Any objections?

comment:15 Changed 2 months ago by jengelh@…

Interesting approach. Do you have a .jar of this I could test?

comment:16 Changed 2 months ago by stoecker

I'd say: Let's test it!

comment:17 Changed 2 months ago by Klumbumbus

I think we should made this configurable at wiki:Help/Preferences/Display#OSMData (or atleast via advanced preferences), so users which don't have performance issues can disable it. For my taste thats a bit too much "flickering" when moving the map around.

comment:18 Changed 2 months ago by Klumbumbus

Additional: We could also set the default of setting::highway_labels to false in the mappaint style. I have disabled the display of street names in my josm as it creates too much clutter for me and changing street names is a very seldom task (and in this case I would use Coloured Streets anyway.)

Last edited 2 months ago by Klumbumbus (previous) (diff)

comment:19 in reply to:  15 Changed 2 months ago by Don-vip

Replying to jengelh@…:

Interesting approach. Do you have a .jar of this I could test?

Please check with download/josm-custom.jar.

comment:20 in reply to:  17 Changed 2 months ago by Don-vip

Replying to Klumbumbus:

For my taste thats a bit too much "flickering" when moving the map around.

Please test :) When playing with it I find this to be a nice feature. It can be useful to hide labels with a right click, in dense urban areas, it allows to spot more details.

comment:21 in reply to:  14 Changed 2 months ago by michael2402

@All: When testing such issues, set the mappaint.render.benchmark preference to true, then rendering times will be printed on the console. Phase 1 should be cached and near 0.

I'm at ~200ms with several halo paths on a slow machine (~10 years old, Intel Core 2 Duo @ 1.2GHz)

Replying to bastiK:

A possible explanation, that comes to mind is that Java tries to delegate the rendering to the graphics card, but the result is a complete failure.

You can check this very easily: If CPU load is near 100%, it's a problem on our side (or the way Java renders code).

I'm guessing it has something to do with font rendering.

Replying to Don-vip:

We can disable text rendering while moving the map (see patch). It seems to improve drastically the performances without really affecting the rendering: we're not really able to read the text while moving the map. Any objections?

Move the flag check into the isShowNames() method or use a new shouldRenderNames() method. Otherwise we will easily miss it when moving code around ;-)

Changed 2 months ago by Klumbumbus

Attachment: 02.gif added

comment:22 Changed 2 months ago by Klumbumbus

Yes, the street labels really make a huge difference in performance, ~4x slower in my test with v13657 attachment:02.gif

Last edited 2 months ago by Klumbumbus (previous) (diff)

Changed 2 months ago by Klumbumbus

Attachment: 03.gif added

comment:23 Changed 2 months ago by Klumbumbus

With patch: performance on move is better, however not on hover. see attachment:03.gif. without street labels every line is highlighted when moving the mouse over them, with street labels only one of the 10 lines.

comment:24 Changed 4 weeks ago by Don-vip

In 13875/josm:

see #16128, see #16251 - display street labels on z18+, operation very costly on urban areas

Modify Ticket

Change Properties
Set your email in Preferences
Action
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 jengelh@inai.de
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.