logo separator

[mkgmap-dev] [PATCH] swap pow for sqrt to save time

From Mark Burton markb at ordern.com on Sun Feb 15 18:38:43 GMT 2009

Hi,

I was looking at hprof output for mkgmap after having processed quite a
large map and about 40% of the time was being spent in Math.pow() - the
attached patch swaps out the pow(x, 0.5) for sqrt(x) and the run time
drops from 130 seconds to around 83! Is there any reason not to go for
the sqrt version? If not, it's well worth making the change.

Cheers,

Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mb-mpr-distance-use-sqrt.patch
Type: text/x-patch
Size: 572 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090215/f5d8f1b5/attachment.bin 


More information about the mkgmap-dev mailing list