[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master f18af6c: Audit use of lsh and fix glitches

From: Pip Cet
Subject: Re: [Emacs-diffs] master f18af6c: Audit use of lsh and fix glitches
Date: Wed, 22 Aug 2018 13:49:13 +0000

On Wed, Aug 22, 2018 at 1:36 PM Ken Brown <address@hidden> wrote:
> On 8/22/2018 8:36 AM, Pip Cet wrote:
> > On Tue, Aug 21, 2018 at 9:01 PM Paul Eggert <address@hidden> wrote:
> >>      * lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width,
> >>      prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1
> >>      32)) (Bug#32485#11).
> >
> > I think the previous code was correct: now we have bignums, we should
> > no longer return 'unsupported on machines with 30/32-bit fixnums,
> I think you're missing the point of that code.  The function is
> vc-hg-state-fast.  If it returns 'unsupported, that simply means that
> the slower function will be used.

Thanks for pointing that out. For those who haven't read the code, the
"slower function" actually runs the hg binary, an operation that can
easily take 100 ms or more, instead of sacrificing the few extra
microseconds operating on bignums would cost.

That's precisely why `most-positive-fixnum' is dangerous to rely on:
if you use it for performance tuning, you're likely to make the wrong
decision, by going through an expensive alternative bignum

reply via email to

[Prev in Thread] Current Thread [Next in Thread]