[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35562: "varset" bytecode inline path is never taken
From: |
Noam Postavsky |
Subject: |
bug#35562: "varset" bytecode inline path is never taken |
Date: |
Sat, 04 May 2019 12:10:12 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Simon Frankau <sgf@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)))