From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel,gmane.emacs.diffs Subject: Re: [Emacs-diffs] master 81a1088: Tweak builtin symbol order for speed Date: Fri, 12 Jul 2019 07:12:42 +0000 Message-ID: References: <20190712060726.23831.95266@vcs0.savannah.gnu.org> <20190712060728.23C8920536@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="206327"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-diffs@gnu.org To: emacs-devel@gnu.org, Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 12 09:13:31 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlpkI-000rSp-DH for ged-emacs-devel@m.gmane.org; Fri, 12 Jul 2019 09:13:30 +0200 Original-Received: from localhost ([::1]:47110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlpkD-00038E-7I for ged-emacs-devel@m.gmane.org; Fri, 12 Jul 2019 03:13:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33380) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlpkA-000388-I8 for emacs-devel@gnu.org; Fri, 12 Jul 2019 03:13:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlpk9-0006ZT-4Y for emacs-devel@gnu.org; Fri, 12 Jul 2019 03:13:22 -0400 Original-Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]:41679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlpk8-0006RS-Vd; Fri, 12 Jul 2019 03:13:21 -0400 Original-Received: by mail-oi1-x22f.google.com with SMTP id g7so6550077oia.8; Fri, 12 Jul 2019 00:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jbzEvRL4jFN1dSAkr4t6Hx5Kiq3OOxTlp7ct+wcLoAM=; b=otTsdyDfli6EuzusUb8ONkAc/BYpSBxeC6ZgXtrbqEYubUMBUsnq09K4AEJkEsW4AY d548X/LVAVlTkKOI4sEOYUcOgM+15bbezoY22am8YsbL4CGQlVHlZWB9eEKGhc3L/npK 0xgZip4wXM3lybiduwFXwaVGhYuCqaz2nHZ+VEppxNyKWGZc2aNghjZDpO1LmiAYhcOJ V1Y744fUN4g610GJL4BwQGLXdB7of9PUCk5vA/JvCnmjqG9xfqYjK+DfvFYLCP2AckZf HXr8Ut4v6OzX9pLlGEjjbo7Ckm8oOo/2CbRHFnW6U6bsq6BT/ugGmznrBR6mmCsbRb0y 1tUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jbzEvRL4jFN1dSAkr4t6Hx5Kiq3OOxTlp7ct+wcLoAM=; b=tFbchFZm7OBbhEYftFDcjYnkcqHUXm5XDV9coM4cDuVVi10yJBNmaDa+Z5ONNol185 A1duF1BRLQHDENaknLjDoWcuhfTOTrfkvq8MtFWfYDdlo1dx4dpUB2aNskDODbppfd1o +hBP7i9RJuWkhTLtSZOGum1O5Ch3NQkyuCUpz3fTXVt/nwupYz7Qqlddxb1ABSYkjhjn q4g8hSaWrDSR9eB5812GE6I6FFGjAAbcC2AeXrnpm0iYFkOXjqt1S315C9hhZdHHi9S8 PTaqNMDmh7FVqYqxCX+5vAvA80nXfwdcct0c28xfcZaKCWZA5zC8Tcd3HkKSa+5rST+s ZYew== X-Gm-Message-State: APjAAAUfn0Kq15/yT7U24cFLpAwGR+kRLJnQzO8zDUCJEisf5lwGQPVl cuf86bFM+qaF2rap/NJyQdNdxxmQSzL7UUItHg8m1w== X-Google-Smtp-Source: APXvYqzoPZ8NttvvQHx4IkEG3gjwxqnR1OGu82gTBI1/P0r1CcCrLpEWUwajIXRUj6C0hyyK6FpCfad3pmSXCC08q5o= X-Received: by 2002:aca:be88:: with SMTP id o130mr4943694oif.122.1562915599299; Fri, 12 Jul 2019 00:13:19 -0700 (PDT) In-Reply-To: <20190712060728.23C8920536@vcs0.savannah.gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238517 gmane.emacs.diffs:151414 Archived-At: On Fri, Jul 12, 2019 at 6:07 AM Paul Eggert wrote: > branch: master > commit 81a1088ee8b833cd30a3363782195d6c4d575672 > Author: Paul Eggert > Commit: Paul Eggert > > 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 =E2=80=98make compile-always=E2=80=99 performanc= e 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 =3D=3D SYMBOL) > { > - bool a_nil =3D strcmp (ga->name, "Qnil") =3D=3D 0; > - bool b_nil =3D strcmp (gb->name, "Qnil") =3D=3D 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[]"?