From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master f18af6c: Audit use of lsh and fix glitches Date: Wed, 22 Aug 2018 13:49:13 +0000 Message-ID: References: <20180821204437.16880.99611@vcs0.savannah.gnu.org> <20180821204439.62390209A6@vcs0.savannah.gnu.org> <53d0c06e-2383-955a-0a17-650fd842b483@cornell.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1534945710 3568 195.159.176.226 (22 Aug 2018 13:48:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2018 13:48:30 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: kbrown@cornell.edu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 22 15:48:26 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsTUo-0000nr-CJ for ged-emacs-devel@m.gmane.org; Wed, 22 Aug 2018 15:48:26 +0200 Original-Received: from localhost ([::1]:59185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsTWu-00049Q-E2 for ged-emacs-devel@m.gmane.org; Wed, 22 Aug 2018 09:50:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsTWD-00045S-QS for emacs-devel@gnu.org; Wed, 22 Aug 2018 09:49:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsTWD-0004qh-0K for emacs-devel@gnu.org; Wed, 22 Aug 2018 09:49:53 -0400 Original-Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:34799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsTWC-0004po-Oe for emacs-devel@gnu.org; Wed, 22 Aug 2018 09:49:52 -0400 Original-Received: by mail-lj1-x241.google.com with SMTP id f8-v6so1503840ljk.1 for ; Wed, 22 Aug 2018 06:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Zu4/E945GTLy2244JQHcGGB/umv0yKY8Mr1EHJENmq8=; b=p1OJWg/qP9ib6MO7TQ6YgvQXXS+xlwoylM1kp8MS1o/5fZ8X619eYSQR/BCgvG3ixi OOvpKecoboS82vp8c9qbvrHuaKCrQlxgP6fE5SOoqkf4BXTHBQHlcXe0SENBJp6hN53z 6aGeWiJWbhc+HGS04tdBJO633ODIPY5Rtsv7QrCqpfyHcbDaGhB2zhdNhL8XYaqKAXTK Rd95JKSWvh4irfs1I5wjnfBvkToUthizhSezalPamgdZ3plSSEpiMoCDBIEW2UHAVOxB YmeQqLRf+ZGT6X8G6QoNdTtwHHUzt7qHHO9FYi+8qFzEeAgIWoc706QAFP8In2tpCyAt jPtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zu4/E945GTLy2244JQHcGGB/umv0yKY8Mr1EHJENmq8=; b=V4f1DwQ7d2ChD8Xw5yJ8LMNNJMg3LhChD3hjxdriUoFHEiYiApqXX84x9gLsPlVNfe 9/TzfcMjJWWN4S191AJfNqJ7kxl1kUOqLEMbs48QmiW8Jzxc1ejOthxJURBpquuSKcmg dg5WlpXSTnlq/V+tVMD4cUG79KCkaK+gIuN1LVwc/vF9eDMnbRJY6MJx7yCnAmlflGNu r8iS5UkgjEV+TSMksLHGL1QaX/cl1Yx8TNcFtAmddsbuJkYovN+E4GUdtEBBoELhcwEw Dmg9KbPW2CmQDJD5GIsHohumeCdgPX9Sj1zDP00vrY61nAkFykVC4jSLYFqLD/p43/dI EQkQ== X-Gm-Message-State: APzg51DK99nHVaCvrtfWNFRivIHBrWk/0ui4a/dxXKKlUg730jKCbmvo 1w5hQUcf00krXE5n4bE7Sp5UFC7DPij+mEsvd9Y= X-Google-Smtp-Source: ANB0Vda8dEC1NXI95uuMgJ7x9dXvqbAaq/I4CuQbVp3JKxIxBBCviFhaptFT/73mPED08WfznZkONfLw/JtKOYJ29tg= X-Received: by 2002:a2e:8652:: with SMTP id i18-v6mr2303081ljj.43.1534945791519; Wed, 22 Aug 2018 06:49:51 -0700 (PDT) In-Reply-To: <53d0c06e-2383-955a-0a17-650fd842b483@cornell.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228808 Archived-At: On Wed, Aug 22, 2018 at 1:36 PM Ken Brown wrote: > On 8/22/2018 8:36 AM, Pip Cet wrote: > > On Tue, Aug 21, 2018 at 9:01 PM Paul Eggert 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 implementation.