From: Paul Eggert <eggert@cs.ucla.edu>
To: Dmitry Antipov <antipov@mvista.com>
Cc: emacs-devel@gnu.org
Subject: Re: immediate strings
Date: Sat, 26 Nov 2011 13:13:22 -0800 [thread overview]
Message-ID: <4ED15672.9030600@cs.ucla.edu> (raw)
In-Reply-To: <4ED0F7ED.8050700@yandex.ru>
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.
next prev parent reply other threads:[~2011-11-26 21:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-26 2:15 immediate strings Dmitry Antipov
2011-11-26 7:56 ` Andreas Schwab
2011-11-26 8:05 ` Paul Eggert
2011-11-26 10:03 ` Eli Zaretskii
2011-11-26 14:28 ` Stefan Monnier
2011-11-26 14:30 ` Dmitry Antipov
2011-11-26 21:13 ` Paul Eggert [this message]
2011-11-28 4:19 ` --with-wide-int Stefan Monnier
2011-11-28 7:56 ` --with-wide-int Paul Eggert
2011-11-28 16:52 ` --with-wide-int Stefan Monnier
2011-11-28 18:04 ` --with-wide-int Dan Nicolaescu
2011-11-28 18:34 ` --with-wide-int Eli Zaretskii
2011-11-28 19:35 ` --with-wide-int Stefan Monnier
2011-11-29 4:26 ` --with-wide-int Stephen J. Turnbull
2011-11-29 7:35 ` --with-wide-int Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ED15672.9030600@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=antipov@mvista.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.