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: Simon Frankau <sgf <at> arbitrary.name>
To: 35562 <at> debbugs.gnu.org
Subject: bug#35562: "varset" bytecode inline path is never taken
Date: Sat, 4 May 2019 14:27:23 +0100
[Message part 1 (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 2 (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.