[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: immediate strings
From: |
Paul Eggert |
Subject: |
Re: immediate strings |
Date: |
Sat, 26 Nov 2011 13:13:22 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
On 11/26/11 06:30, Dmitry Antipov wrote:
> IIUC, string length can't be larger than most positive Lisp integer,
> which is smaller than BITS_PER_EMACS_INT - 1 size bitfield anyway.
Ah, sorry, I should have mentioned that I was thinking in the
context of the patch for bug#9874, which improves performance on
32-bit platforms configured --with-wide int (so EMACS_INT is 64
bits, ptrdiff_t 32) by shrinking struct Lisp_String as follows:
struct Lisp_String
{
- EMACS_INT size;
- EMACS_INT size_byte;
+ ptrdiff_t size;
+ ptrdiff_t size_byte;
INTERVAL intervals; /* text properties in this string */
unsigned char *data;
};
In this environment we can still steal one bit from size and from size_byte
without shrinking the maximum string length, but we'd need to use some
other way to mark a string as multibyte, since size_byte would become an
unsigned bitfield.
I'm more optimistic than Eli and Stefan in thinking that something along
the lines of a size+byte_size+intervals packing approach would yield a
performance win that's worth the maintenance hassle. But of course all
this will require a reasonable amount of hacking and measuring.
- immediate strings, Dmitry Antipov, 2011/11/25
- Re: immediate strings, Andreas Schwab, 2011/11/26
- Re: immediate strings, Paul Eggert, 2011/11/26
- Re: immediate strings, Eli Zaretskii, 2011/11/26
- Re: immediate strings, Dmitry Antipov, 2011/11/26
- Re: immediate strings,
Paul Eggert <=
- --with-wide-int, Stefan Monnier, 2011/11/27
- Re: --with-wide-int, Paul Eggert, 2011/11/28
- Re: --with-wide-int, Stefan Monnier, 2011/11/28
- Re: --with-wide-int, Dan Nicolaescu, 2011/11/28
- Re: --with-wide-int, Eli Zaretskii, 2011/11/28
- Re: --with-wide-int, Stefan Monnier, 2011/11/28
- Re: --with-wide-int, Stephen J. Turnbull, 2011/11/28
- Re: --with-wide-int, Paul Eggert, 2011/11/29