GNU bug report logs - #35562
"varset" bytecode inline path is never taken

Previous Next

Package: emacs;

Reported by: Simon Frankau <sgf <at> arbitrary.name>

Date: Sat, 4 May 2019 15:37:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Simon Frankau <sgf <at> arbitrary.name>
Subject: bug#35562: closed ("varset" bytecode inline path is never taken)
Date: Sat, 04 May 2019 18:17:02 +0000
[Message part 1 (text/plain, inline)]
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 35562 <at> debbugs.gnu.org.

-- 
35562: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35562
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Simon Frankau <sgf <at> arbitrary.name>
Cc: 35562-done <at> debbugs.gnu.org
Subject: "varset" bytecode inline path is never taken
Date: Sat, 4 May 2019 11:16:23 -0700
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.

[Message part 3 (message/rfc822, inline)]
From: Simon Frankau <sgf <at> arbitrary.name>
To: bug-gnu-emacs <at> gnu.org
Subject: "varset" bytecode inline path is never taken
Date: Sat, 4 May 2019 14:27:23 +0100
[Message part 4 (text/plain, inline)]
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.
[Message part 5 (text/html, inline)]

This bug report was last modified 6 years and 97 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.