GNU bug report logs - #65491
[PATCH] Improve performance allocating vectors

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Thu, 24 Aug 2023 10:00:02 UTC

Severity: wishlist

Tags: patch

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 65491 <at> debbugs.gnu.org, mattias.engdegard <at> gmail.com, monnier <at> iro.umontreal.ca
Subject: bug#65491: [PATCH] Improve performance allocating vectors
Date: Sun, 17 Sep 2023 08:22:01 -0700
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.





This bug report was last modified 1 year and 263 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.