logo separator

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

From Steve Ratcliffe steve at parabola.demon.co.uk on Mon Feb 16 23:18:33 GMT 2009

On Mon, Feb 16, 2009 at 11:15:29PM +0000, Mark Burton wrote:
> 
> > 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.
> 
> Did anyone think this was a bad idea? If not, I shall commit that change
> in the morning.

It didn't make a lot of difference with the file I tried it with, but
seems like the right thing to do.

..Steve



More information about the mkgmap-dev mailing list