[PATCH v2] quick distance calculation

Added distanceInDegreesSquared() to be used where relative distances are required (i.e. finding closest city). Now quickDistance() just calls distanceInDegreesSquared() and applies the sqrt and scaling. Still using quickDistance() instead of slowDistance() for all other distance calculations. ---------------- Folks, OK, so the parallelisation code has not been very successful so far but we can still speed up mkgmap. You have probably noticed that it spends a huge proportion of its time in Math.acos() which is being called from Coord.distance(). The attached patch renames distance() to slowDistance() and introduces a new quickDistance() function that is based on the code that was in the MultipolygonRelation class. I have tested quickDistance() against slowDistance() and for maps in the UK and Germany it produces distances that are very similar (within 0.5% or better). It is substantially faster and so I believe we should change to using it as long as it doesn't introduce any issues. So please try out this patch and report: a - if any breakage is observed b - performance increase/decrease Cheers, Mark

On Wed, May 20, 2009 at 11:53 AM, Mark Burton <markb@ordern.com> wrote:
So please try out this patch and report:
a - if any breakage is observed
b - performance increase/decrease
I have tested the v2 patch and have not observed any breakage. There also seems to be a performance improvement compared to v1 (much to my surprise), but I have not done any rigorous measurements. Cheers.

Hi Clinton,
I have tested the v2 patch and have not observed any breakage. There also seems to be a performance improvement compared to v1 (much to my surprise), but I have not done any rigorous measurements.
Yes, the v2 patch is a little more efficient than the v1. Thanks for the feedback. Cheers, Mark

Are people still evaluating this patch? If so, has anyone noticed any problems? I am thinking about committing it to trunk some time as it provides a worthwhile speedup. Cheers, Mark

On Wed, May 27, 2009 at 5:22 PM, Mark Burton <markb@ordern.com> wrote:
Are people still evaluating this patch? If so, has anyone noticed any problems? I am thinking about committing it to trunk some time as it provides a worthwhile speedup.
I have had this patch applied for some time, and have used it for car and bicycle routing: I have not noticed any difference in routing behaviour. It is probably safe to commit. Thanks and Cheers.
participants (2)
-
Clinton Gladstone
-
Mark Burton