75% speedup for zdump on 64-bit Solaris sparc

Ken Pizzini tz. at explicate.org
Fri Mar 10 04:11:07 UTC 2006

On Thu, Mar 09, 2006 at 01:34:17PM -0800, Paul Eggert wrote:
> >> ! 				i--;
> >> ! 				if (sp->ats[i - 1] <= t)
> >> ! 					goto found;
> >
> > If i == lo (== 1), and the first <=t test fails
> That can't happen, due to a previous test of t against sp->ats[0] (in
> earlier code) which will will cause all the quoted code to be
> bypassed.  So I don't see any bug there.

Ah, tricky.  You're right of course: that case is handled by the other
branch of the "if" clause for which this search is the "else" clause.
My vision was too tunneled.  OTOH, having so many control structures
between the critical test and this one seems to make the code somewhat
brittle (IMO); and this all is probably moot unless someone speaks up
for preferring the (small) performance gain over the complexity added.

		--Ken Pizzini

More information about the tz mailing list