Subject: bug#32405: Turning misc objects into pseudovectors

From: Paul Eggert <[email-masked]>
Date: Wed, 8 Aug 2018 22:01:09 -0700

> AFAIK the main issue with pseudovectors is that their allocation is
> slower and suffers more from fragmentation (because we don't use
> a size-segregated allocation algorithm (like Linux's SLAB, for example)
> for them).

Pseudovectors do have size-segregated allocation; see the vector_free_lists 
array. Although it's not as fancy as Linux's SLAB, I hope it's enough for Emacs; 
if not we could of course make it fancier.

To some extent the point of this change is that we don't need a separate 
Lisp_Object tag in order to have size-segregated allocation, since pseudovectors 
already do that.

> Are you sure the new code is faster overall?

That's what I measured with 'make compile-always', yes. Of course this is just 
one benchmark. (My original intuition was that nobody would notice the 
difference....)

> There is also a potential issue in terms of the resulting heap size of
> markers (which may bump up from 6 words to 8 words, IIRC, unless your
> patch does something to keep it down to 6)

On a 64-bit platform the heap size of markers does not grow. The old size is 6 
words (sizeof (union aligned_Lisp_Misc) is 48), and the new size is also 6 words 
(sizeof (struct Lisp_Marker) is also 48).