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

Anton Lundin glance at acc.umu.se
Wed Jan 22 12:47:06 UTC 2014


On 22 January, 2014 - Linus Torvalds wrote:

> On Wed, Jan 22, 2014 at 8:25 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
> >
> > What I think would be the right thing to do is similar to what I think
> > most dive computers do as well:
> >
> > Calculate a constant rate ascent until we would actually cross above the
> > ceiling (so not, "ascend from where we are NOW to the ceiling for NOW",
> > but instead "ascend until by going up another 3m/10ft we would violate
> > the then current ceiling"). Then wait in increments of full minutes
> > until we can ascend to the next 3m/10ft potential stop (using the same
> > logic as above).
> 
> That is very close to what we do now, with the addition of the
> 1-minute stop granularity (which is what my one-liner patch did).
> 
> But your "go up another 3m" is ambiguous. Do you mean "go up 3m from
> where we are now" (which is *not* what the code does now) or do you
> mean "go up to the next 3m boundary" (which is pretty much exactly
> what the code does now.
> 
> So if you mean "go up to the next 3m boundary, but then stop for whole
> minutes", then that is literally exactly what changing time_stepsize
> from 10 to 60 would do.
> 
> Side note: adding Anton explicitly to the Cc, to see if he has
> comments and might not have noticed the mailing list thread. He's the
> original author of the code in question. Anton - mind checking my
> commentary on the TTS algorithm in my previous mail in the thread? I
> might have missed something..
> 

I've seen this thread and I'm planning to read it, but I'm kinda busy
right now with deliveries to customers, planning a trip to Africa and
I'm getting married this weekend so its probably going to be next week
before i can have some time over to actually think about this =)

//Anton

-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list