From: Pip Cet <pipcet@gmail.com>
To: emacs-devel@gnu.org, Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-diffs@gnu.org
Subject: Re: [Emacs-diffs] master 81a1088: Tweak builtin symbol order for speed
Date: Fri, 12 Jul 2019 07:12:42 +0000 [thread overview]
Message-ID: <CAOqdjBcDi+QtasfUCxu3yei+6QS76=DNj-P_M=DWAZmyG6jyJA@mail.gmail.com> (raw)
In-Reply-To: <20190712060728.23C8920536@vcs0.savannah.gnu.org>
On Fri, Jul 12, 2019 at 6:07 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
> branch: master
> commit 81a1088ee8b833cd30a3363782195d6c4d575672
> Author: Paul Eggert <eggert@cs.ucla.edu>
> Commit: Paul Eggert <eggert@cs.ucla.edu>
>
> Tweak builtin symbol order for speed
>
> * lib-src/make-docfile.c (compare_globals):
> Make symbols 1 through 4 be t, unbound, error, lambda.
> This is in addition to symbol 0 being nil.
> This change improved ‘make compile-always’ performance by 0.6%
> on my platform.
Hmm. I don't understand why this would improve performance this
significantly (maybe because it allows 8-bit offsets to be used rather
than 32-bit ones?). It will make debugging a tad easier, though.
XIL(0x30) for Qt is easy to remember.
Maybe it would be a good idea to make Vdead a symbol (or a tagged NULL
pointer) and treat it similarly, if this actually improves
performance.
> ---> lib-src/make-docfile.c | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
> index 4d25b0a..368150b 100644
> --- a/lib-src/make-docfile.c
> +++ b/lib-src/make-docfile.c
> @@ -641,13 +641,24 @@ compare_globals (const void *a, const void *b)
> return ga->type - gb->type;
>
> /* Consider "nil" to be the least, so that iQnil is zero. That
> - way, Qnil's internal representation is zero, which is a bit faster. */
> + way , Qnil's internal representation is zero, which is a bit faster.
> + Similarly, consideer "t" to be the second-least, and so forth. */
"consider"
> if (ga->type == SYMBOL)
> {
> - bool a_nil = strcmp (ga->name, "Qnil") == 0;
> - bool b_nil = strcmp (gb->name, "Qnil") == 0;
> - if (a_nil | b_nil)
> - return b_nil - a_nil;
> + /* Common symbols in decreasing popularity order. */
> + static char const commonsym[][8]
I'm curious, why isn't this simply "static char *commonsym[]"?
next parent reply other threads:[~2019-07-12 7:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190712060726.23831.95266@vcs0.savannah.gnu.org>
[not found] ` <20190712060728.23C8920536@vcs0.savannah.gnu.org>
2019-07-12 7:12 ` Pip Cet [this message]
2019-07-14 0:54 ` [Emacs-diffs] master 81a1088: Tweak builtin symbol order for speed 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='CAOqdjBcDi+QtasfUCxu3yei+6QS76=DNj-P_M=DWAZmyG6jyJA@mail.gmail.com' \
--to=pipcet@gmail.com \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=emacs-diffs@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.