From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#65491: [PATCH] Improve performance allocating vectors Date: Sun, 17 Sep 2023 08:22:01 -0700 Organization: UCLA Computer Science Department Message-ID: References: <6B2EDD07-AAEB-40E8-B369-F634296BD3D9@gmail.com> <83v8cagkqv.fsf@gnu.org> <83ttrugkj2.fsf@gnu.org> <83r0mygi4y.fsf@gnu.org> <8af6fa1c-4873-bd6e-e896-ab5bb8d012a2@cs.ucla.edu> <83led5gyxa.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22155"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Cc: 65491@debbugs.gnu.org, mattias.engdegard@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 17 17:23:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qhtc7-0005T0-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Sep 2023 17:23:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhtbu-0006Ev-BA; Sun, 17 Sep 2023 11:22:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhtbt-0006Em-7A for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 11:22:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhtbs-0003q0-VP for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 11:22:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhtc0-0000hH-KK for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 11:23:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2023 15:23:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65491-submit@debbugs.gnu.org id=B65491.16949641432562 (code B ref 65491); Sun, 17 Sep 2023 15:23:04 +0000 Original-Received: (at 65491) by debbugs.gnu.org; 17 Sep 2023 15:22:23 +0000 Original-Received: from localhost ([127.0.0.1]:51175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhtbK-0000f9-SS for submit@debbugs.gnu.org; Sun, 17 Sep 2023 11:22:23 -0400 Original-Received: from mail.cs.ucla.edu ([131.179.128.66]:49096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhtbD-0000eL-OG for 65491@debbugs.gnu.org; Sun, 17 Sep 2023 11:22:17 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 022DE3C00D189; Sun, 17 Sep 2023 08:22:02 -0700 (PDT) Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id G5kLHPnBVKSn; Sun, 17 Sep 2023 08:22:01 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id A32583C00D18A; Sun, 17 Sep 2023 08:22:01 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu A32583C00D18A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1694964121; bh=xN/mZDc41F7KyjDrb2Y2hQchxAYjHir7cIh9E//mz2Q=; h=Message-ID:Date:MIME-Version:To:From; b=MQ1AHq0bO4m/Yut3/wBe/0Ez83P8gpsWS+mfMUVdK4iYtMylUqeoUy2Gx/ure+Fy0 O4BaI1fHU4DH/mRNxUD6Dx0pCQZQWauGXLQzTRHK/kmcv2jMJ4t88mf/XeR76McFtz rgE9gEN39mINOSyRLg3bkdihtX5F2mZZy96nufzAvzUHFTcvHPYMxtTOfmhQ8fgfHY j+uAthbLVzfCrMwYchsCrXYWozCTC5hAW836NJm2ypb8+psKKFzIInRjzq9eWCGYSE pDOeuOJWjHjqCXT4UUaLEDiRntbbC68BLtd3/9O+zwkkMt/b7oBSNL9J+1Iea5xx+A 6GroFnvwOJWlw== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FsLvt-811IIE; Sun, 17 Sep 2023 08:22:01 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 7ADFD3C00D189; Sun, 17 Sep 2023 08:22:01 -0700 (PDT) Content-Language: en-US In-Reply-To: <83led5gyxa.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270709 Archived-At: On 2023-09-16 22:18, Eli Zaretskii wrote: > It seems to me that in a 32-bit build with wide > ints just > > #define XUNTAG(a, type, ctype) ((ctype *) XLP (a)) > > should be enough, since XLP yields a 'void *', no? That would complicate the code unnecessarily. Let's not go there. Patch P works as-is, and it's simpler. Let's do that instead. > what I > meant was to have a separate definition of XUNTAG for 32-bit builds > with wide ints (which could still remove the undefined behavior), Yes, that's exactly what I suggest not to do. Why complicate the source code unnecessarily? And if we complicate it here, why not complicate it in similar ways in dozens of other places? I went through a lot of this when adding support for --with-wide-int in the first place, years ago. When doing so, I strove to avoid having multiple copies of the code whenever I could. And I pretty much succeeded: there are only two WITH_WIDE_INT conditionals in lisp.h (and only three in other source files, all introduced relatively recently by others to work around compiler bugs, and all which should be rewritten without the #if). It's an obvious win to have just one copy of the code instead of two, when one copy works and is just as efficient. As much as possible, --with-wide-int should not be a special case. We should not have "#ifdef WITH_WIDE_INT" scattered all over the place. Keep it simple.