[PATCH] Stop doing the (very expensive) pow() calculation pointlessly

Dirk Hohndel dirk at hohndel.org
Sun Jan 19 13:51:36 UTC 2014


On Jan 19, 2014, at 1:03 PM, Linus Torvalds <torvalds at linux-foundation.org> wrote:

> On Sun, Jan 19, 2014 at 12:42 PM, Tomaz Canabrava <tcanabrava at kde.org> wrote:
>> The result of this patch is this:
>> http://wstaw.org/m/2014/01/19/plasma-desktopujz493.png
>> it still looks like it deserves some kind of special treatment, but it's way
>> faster now.
> 
> So you seem to have TTS enabled (time-to-surface).
> 
> What do you use as a test-case? Because there are a few tests in there
> that generate horrible TTS loads because they are actually bad dives
> with tons of deco, and then the TTS calculations just explode.
> 
> Anyway, for the TTS calculations, try this trivial patch that makes
> the TTS code use a 1-minute step-size rather than calculate things at
> a 10s interval.

And it turns out that change has a rather significant impact on the results.

Try it on my dive 222. I see differences of 3 minutes in TTS with and without this patch.

e.g., 15:00 into that dive I get 23 minutes without your patch but 26 minutes TTS with
the patch using 60 seconds granularity (this is with GF 30/75 in case you want to reproduce).

So while I appreciate that it’s faster, I worry about the >10% change in result…

I tried a somewhat more extreme case. GF 10/50, 22:30 into the dive. 167/190 minutes.

I think I’ll have to NAK that patch...

/D


More information about the subsurface mailing list