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: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#35562: closed ("varset" bytecode inline path is never taken)
Date: Sat, 04 May 2019 18:17:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 4 May 2019 11:16:23 -0700
with message-id <e44856a7-bb0d-f3fd-bd3b-c27b4a18af43 <at> cs.ucla.edu>
and subject line "varset" bytecode inline path is never taken
has caused the debbugs.gnu.org bug report #35562,
regarding "varset" bytecode inline path is never taken
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> 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: 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 3 (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 4 (text/html, inline)]
[Message part 5 (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.


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.