Opened 5 years ago

Closed 5 years ago

Last modified 17 months ago

#13295 closed enhancement (fixed)

[Patch] improve UnconnectedWays test

Reported by: GerdP Owned by: team
Priority: normal Milestone: 16.07
Component: Core Version:
Keywords: Cc:


In the method
MyWaySegment.getBounds(double fudge)
is called with the parameter dist which gives the distance in m, but the method uses the value
as latlon degrees. As a result, the calculated bbox is far too large and the search in the
QuadBuckets structure returns more or less all data instead of a few nodes which are then searched sequentially.
I've attached a patch that converts the value. I assume that this also means that the code
regarding nearbyNodeCache is obsolete.

Attachments (1)

bbox_calculation.patch (1.2 KB) - added by GerdP 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by GerdP

Attachment: bbox_calculation.patch added

comment:1 Changed 5 years ago by Don-vip

Milestone: 16.07

comment:2 Changed 5 years ago by GerdP

I did a few more tests. Without the patch the cache structure was very helpfull:
in a test file with ~6200 highway ways I see
DEBUG: Running test Unconnected highways
DEBUG: cache hit/miss 27893 / 27893
DEBUG: Test 'Unconnected highways' completed in 2.9 s
When I change the code to ignore the cache:
DEBUG: Running test Unconnected highways
DEBUG: cache hit/miss 0 / 55786
DEBUG: Test 'Unconnected highways' completed in 5.5 s

With the patch the times are 169 ms against 186 ms, so the cache still
gives a small benefit, but not much compared to the code complexity.

When you set validator.UnconnectedWays.way_way_distance to e.g. 0.5 in preferences
the cache is used two times more often and the timings are 182 ms against 245 ms
and also the complex code for the cache is used.
So, after all, I'd say we can keep the cache, it doesn't require much memory and can save
a few CPU cycles.

comment:3 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10776/josm:

fix #13295 - improve UnconnectedWays test performance (patch by gpetermann_muenchen)

comment:4 Changed 5 years ago by Don-vip


comment:5 Changed 17 months ago by Don-vip

Ticket #10137 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.