all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Lisp_Marker size on 32bit systems
Date: Fri, 07 Sep 2018 15:45:54 -0400	[thread overview]
Message-ID: <jwvr2i5qg8c.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <0e358c21-1e67-32f9-d24b-fa039753a2de@cs.ucla.edu> (Paul Eggert's message of "Fri, 7 Sep 2018 12:04:16 -0700")

>> Where does this 20% slow down come from?
> Ha! It was because the 16-byte alignment caused pure space to overflow,
> which disabled GC.  No wonder there was such a big performance difference.

OK, that makes more sense.

> I fixed that, and now the patch to shrink marker allocations from 32 to 24
> bytes on x86 causes my standard benchmark (make compile-always) to run only
> 1.0% slower, which is more reasonable.  A microbenchmark of running
> (make-marker) over and over again for 10,000,000 times runs 36% slower (815
> vs 597 ns for a single call).

I still wonder why it would be slower at all.

> Maybe we should be using 4 mark bits instead of 3?

On 32bit systems, both cons cells and float cells use 8 bytes each, so
aligning on multiples of 16 would double their memory use.

And we currently have one free tag, so not only would using 4 tag bits
significantly increase memory use for those objects, but it's not clear
what the extra tags would be useful for.  Also with the bignum support,
the pressure to maximize the size of our fixnums is much lower, so we
could even consider using fewer Lisp_Int tags if we feel like we need
more tags.

FWIW, IIUC XEmacs uses a 2bit tag which simply distinguishes between
Lisp_Int0, Lisp_Int1, Char, and other objects.  Since we don't have
chars, that's like using a single-bit tag for us.

Maybe we should introduce some way to instrument
SYMBOLP/STRINGP/VECTORP/MARKERP/CONSP/... in order to try and figure out
which objects are more deserving of having their tag right there in the
Lisp_Object rather than just in the vectorlike_header.


        Stefan



  reply	other threads:[~2018-09-07 19:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  0:41 Lisp_Marker size on 32bit systems Stefan Monnier
2018-09-06  6:51 ` Paul Eggert
2018-09-06 12:17   ` Stefan Monnier
2018-09-07  7:15     ` Paul Eggert
2018-09-07  8:05       ` Eli Zaretskii
2018-09-07 13:45         ` Paul Eggert
2018-09-07 14:12           ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Stefan Monnier
2018-09-07 14:23             ` Eli Zaretskii
2018-09-07 15:16             ` GDB and compiler-operations Andreas Schwab
2018-09-07 15:48             ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Paul Eggert
2018-09-07 15:58               ` GDB and compiler-operations Stefan Monnier
2018-09-07 17:11                 ` Eli Zaretskii
2018-09-07 17:15                 ` Paul Eggert
2018-09-07 19:59             ` Tom Tromey
2018-09-07 14:19           ` Lisp_Marker size on 32bit systems Eli Zaretskii
2018-09-07 16:27             ` Paul Eggert
2018-09-07 17:16               ` Eli Zaretskii
2018-09-07 18:13                 ` Paul Eggert
2018-09-07 18:32                   ` Eli Zaretskii
2018-09-07 19:05                     ` Paul Eggert
2018-09-07 19:22                       ` Eli Zaretskii
2018-09-07 12:16       ` Stefan Monnier
2018-09-07 19:04         ` Paul Eggert
2018-09-07 19:45           ` Stefan Monnier [this message]
2018-09-07 21:03             ` Paul Eggert
2018-09-08  1:54               ` Stefan Monnier
2018-09-08  3:04                 ` Paul Eggert
2018-09-08  3:10                   ` Stefan Monnier

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=jwvr2i5qg8c.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eggert@cs.ucla.edu \
    --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.