From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Simon Frankau Newsgroups: gmane.emacs.bugs Subject: bug#35562: "varset" bytecode inline path is never taken Date: Sat, 4 May 2019 14:27:23 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007ca4c505880fd4e1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="42402"; mail-complaints-to="usenet@blaine.gmane.org" To: 35562@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 04 17:37:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMwiu-000Au6-Tx for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 17:37:13 +0200 Original-Received: from localhost ([127.0.0.1]:58005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMwit-0005Uu-V2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 11:37:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMwim-0005UO-AD for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 11:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMwil-00054k-AH for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 11:37:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38469) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMwil-00054b-2r for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 11:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMwik-0000W9-Vl for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 11:37:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simon Frankau Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 May 2019 15:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35562 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15569842081951 (code B ref -1); Sat, 04 May 2019 15:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 May 2019 15:36:48 +0000 Original-Received: from localhost ([127.0.0.1]:52011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMwiU-0000VL-7q for submit@debbugs.gnu.org; Sat, 04 May 2019 11:36:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMuhe-0005RX-FQ for submit@debbugs.gnu.org; Sat, 04 May 2019 09:27:46 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMuhZ-0000Ix-C3 for submit@debbugs.gnu.org; Sat, 04 May 2019 09:27:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMuhY-0001Gx-BK for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 09:27:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMuhX-0000Hs-F2 for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 09:27:40 -0400 Original-Received: from mail-s79.mailgun.info ([184.173.153.207]:27775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMuhX-0000H2-8x for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 09:27:39 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=arbitrary.name; q=dns/txt; s=pic; t=1556976459; h=Content-Type: To: Subject: Message-ID: Date: From: MIME-Version: Sender; bh=a6aHY6CyYu6yBtofr8TvgOljXavckg7asCn2yLiGviY=; b=hS6bCUNDODAFWl3Gf09S5JzEw1chnmfcwQ5nKwyTZKglwL8eMYFEtxPCA8oTWS0jEVyE7od4 VSGjfi/B175H//WqfXJ4ld7PuisuwpZSqzTbVDnBMq4YvknWDtvX7Z8DuJI0tCIdNnZz1V/7 Yzvt69E2rNEbuBX2/RyMSWGFe1k= X-Mailgun-Sending-Ip: 184.173.153.207 X-Mailgun-Sid: WyI3MTJmNiIsICJidWctZ251LWVtYWNzQGdudS5vcmciLCAiZDljNWE0Il0= Original-Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mxa.mailgun.org with ESMTP id 5ccd9347.7f013be704f0-smtp-out-n03; Sat, 04 May 2019 13:27:35 -0000 (UTC) Original-Received: by mail-lj1-f173.google.com with SMTP id k8so7460256lja.8 for ; Sat, 04 May 2019 06:27:35 -0700 (PDT) X-Gm-Message-State: APjAAAWugBXf7bdWpOIXdLQtzZnLezo9gvs+x+BTh5FD08y37KL9X2p7 wSotl9WUM7VhF6v21t/goz2pGUnuYEoHxKHiDKI= X-Google-Smtp-Source: APXvYqz6F1zrDMmbqNd+V4huzciKjNit2dpyaOOf2XhjxIZO32mbuRhD1uj5gO1DlogfAubjIt85DmaHTHwMqfOMFEc= X-Received: by 2002:a2e:814e:: with SMTP id t14mr8153315ljg.25.1556976454376; Sat, 04 May 2019 06:27:34 -0700 (PDT) X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sat, 04 May 2019 11:36:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158744 Archived-At: --0000000000007ca4c505880fd4e1 Content-Type: text/plain; charset="UTF-8" While reading the source, I noticed in bytecode.c that: /* Inline the most common case. */ if (SYMBOLP (sym) && !EQ (val, Qunbound) && *!XSYMBOL (sym)->u.s.redirect* && !SYMBOL_TRAPPED_WRITE_P (sym)) SET_SYMBOL_VAL (XSYMBOL (sym), val); should be: /* Inline the most common case. */ if (SYMBOLP (sym) && !EQ (val, Qunbound) && *XSYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL* && !SYMBOL_TRAPPED_WRITE_P (sym)) SET_SYMBOL_VAL (XSYMBOL (sym), val); As it is, the inline case is never run, since "redirect" is always non-zero. Since I'm new to emacs internals, I don't know how to benchmark to work out if this makes a noticable performance difference. :) Thanks, Simon. --0000000000007ca4c505880fd4e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
While r= eading the source, I noticed in bytecode.c that:

= =C2=A0 =C2=A0 /* Inline the most common case.=C2=A0 */
= =C2=A0 =C2=A0 if (SYMBOLP (sym)
&& !EQ (val, Qun= bound)
&& !XSYMBOL (sym)->u.s.redirect=
&& !SYMBOL_TRAPPED_WRITE_P (sym))
<= div> =C2=A0 =C2=A0 =C2=A0 SET_SYMBOL_VAL (XSYMBOL (sym), val);
=

should be:

=C2=A0 = =C2=A0 /* Inline the most common case.=C2=A0 */
=C2=A0 = =C2=A0 if (SYMBOLP (sym)
&& !EQ (val, Qunbound)<= /font>
&& XSYMBOL (sym)->u.s.redirect =3D=3D SYMB= OL_PLAINVAL
&& !SYMBOL_TRAPPED_WRITE_P (sym)= )
=C2=A0 =C2=A0 =C2=A0 SET_SYMBOL_VAL (XSYMBOL (sym), val= );

As it is, the inline case is never= run, since "redirect" is always non-zero.

Since I'm new to emacs internals, I don't know how to benchmark = to work out if this makes a noticable performance difference. :)
Thanks,
Simon.

--0000000000007ca4c505880fd4e1--