Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#19225 closed defect (fixed)

[PATCH] MapRendererPerformanceTest does not render as intended anymore

Reported by: johsin18 Owned by: team
Priority: normal Milestone: 20.06
Component: Unit tests Version: latest
Keywords: Cc:

Description (last modified by simon04)

MapRendererPerformanceTest.testPerformanceDrawFeatures has two major problems (as of revision 16390).

  • Lines are not drawn at all.
  • The code tries to draw multiple variants, one with all features, one with just icons, one with just lines, and so on. However, currently, all variants results in the same output (namely having all features, except for the lines, as stated above).
  • Overall, it draws as depicted in screenshot

I provide not status report as I have found clear bugs in the code already.

Attachments (4)

testPerformanceDrawFeatures-buggy.png (402.1 KB ) - added by johsin18 5 years ago.
test-neubrandenburg-all.png (1.8 MB ) - added by johsin18 5 years ago.
all features after fix
test-neubrandenburg-icon.png (202.9 KB ) - added by johsin18 5 years ago.
just icons, after fix
fix-MapRendererPerformanceTest.patch (8.7 KB ) - added by johsin18 5 years ago.

Change History (11)

by johsin18, 5 years ago

by johsin18, 5 years ago

Attachment: test-neubrandenburg-all.png added

all features after fix

by johsin18, 5 years ago

just icons, after fix

comment:1 by johsin18, 5 years ago

The problems are caused by two things.
The map paint cache is not invalidated after switching the styles, so all variants are drawn like the first one (with all features).
viewWidth and viewHeight of MapViewState stay 0, so all lines are clipped.

The attached patch fixes those problems. However, the patch for the second problem is quite intrusive (overriding setBounds), so there might be better ways of doing it.
In addition, some minor issues are fixed as well.

See the changes commit by commit here:
https://github.com/johsin18/josm/commits/fix-MapRendererPerformanceTest

As the map segment is different now (centered on downtown, seems more reasonable), and all features are actually drawn, the timings are up to 3 times slower.

The resulting images are (all features)

all features after fix

and for example (just icons)

just icons, after fix

Last edited 5 years ago by simon04 (previous) (diff)

by johsin18, 5 years ago

comment:2 by johsin18, 5 years ago

I have made the patch less intrusive. It does not touch any appliation code anymore, just test code. So it should be very safe to merge it in.

I found the working approach in AbstractMapRendererPerformanceTestParent, which raises the questions whether StyledMapRendererPerformanceTest has superseded MapRendererPerformanceTest (at least MapRendererPerformanceTest.testPerformanceDrawFeatures). Then, the later should maybe be removed instead of fixed.

@simon04 Could you have a look maybe?
Some commits just improve the measurement accuracy, you can leave them out if you don't like them.
https://github.com/johsin18/josm/commits/fix-MapRendererPerformanceTest

comment:3 by simon04, 5 years ago

Description: modified (diff)

comment:4 by simon04, 5 years ago

Resolution: fixed
Status: newclosed

In 16542/josm:

fix #19225 - MapRendererPerformanceTest does not render as intended anymore (patch by johsin18, modified)

comment:5 by simon04, 5 years ago

Milestone: 20.06

Thank you!

comment:6 by Klumbumbus, 5 years ago

Component: Core mappaintUnit tests

comment:7 by simon04, 5 years ago

In 16822/josm:

see #19225 - MapRendererPerformanceTest: call DataSet.clearMappaintCache

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.