Subject: bug#35562: closed ("varset" bytecode inline path is never taken)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 04 May 2019 18:17:02 +0000

Your bug report

#35562: "varset" bytecode inline path is never taken

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
35562: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35562
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: "varset" bytecode inline path is never taken
From: Paul Eggert <[email-masked]>
To: Simon Frankau <[email-masked]>
Cc: [email-masked]
Date: Sat, 4 May 2019 11:16:23 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for reporting that typo. I verified that the patch improves performance 
significantly (50% speedup) on Noam's benchmark, and installed the patch into 
the Emacs master branch.

Subject: "varset" bytecode inline path is never taken
From: Simon Frankau <[email-masked]>
To: [email-masked]
Date: Sat, 4 May 2019 14:27:23 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.