emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: immediate strings


From: Stefan Monnier
Subject: Re: Proposal: immediate strings
Date: Thu, 24 May 2012 03:14:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> That might work.  But this raises another idea: assuming most tiny strings
> don't have text properties, won't it improve performance overall if
> any string with text properties is forced to be an ordinary string, so
> that immediate strings can reuse the rarely-used 'intervals' member
> for data?

That's part of the reason why I'm interested in his statistics about
which strings have text properties.

But even if there's a potential gain here, there's still the issue that
we may then have to convert an immediate string into an ordinary string
when text-properties are added, which will imply basically relocating
the string data, with the usual risk that we might happen to do that
right in the middle of a loop keeping a pointer to the inside of the
string's data.

> Another thought that comes to mind, is that we could leave
> the mark bit where it is (the most significant bit of 'size'),
> and reserve 'size' values >= (EMACS_INT / 2 & ~0xffff)

No need to be that careful: the `size' field has 2 free bits (since the
size is limited by what integer can fit in a Lisp_Object), and only 1 is
used (for the markbit), so we could just grab a second bit from `size'
for the `immbit'.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]