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: Noam Postavsky <npostavs <at> gmail.com>
To: Simon Frankau <sgf <at> arbitrary.name>
Cc: 35562 <at> debbugs.gnu.org
Subject: bug#35562: "varset" bytecode inline path is never taken
Date: Sat, 04 May 2019 12:10:12 -0400
Simon Frankau <sgf <at> arbitrary.name> writes:

> While reading the source, I noticed in bytecode.c that:

> && *!XSYMBOL (sym)->u.s.redirect*

> should be:

> && *XSYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL*

> 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. :)

I guess something like this might work (haven't tested to see if
difference is measurable though):

    (defvar bug-35562-test-var nil)
    (benchmark-run-compiled
        (dotimes (_ 1000000)
          ;; Unroll a bit, so that setting `bug-35562-test-var' takes more
          ;; time than incrementing loop counter.
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)
          (setq bug-35562-test-var nil)))




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.