all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Simon Frankau <sgf@arbitrary.name>
Cc: 35562@debbugs.gnu.org
Subject: bug#35562: "varset" bytecode inline path is never taken
Date: Sat, 04 May 2019 12:10:12 -0400	[thread overview]
Message-ID: <87y33mmc9n.fsf@gmail.com> (raw)
In-Reply-To: <CAGQB+MKm3NLrD471ktxK-uNHfWLRk2RWq79iD3fNkJCS0SWyQQ@mail.gmail.com> (Simon Frankau's message of "Sat, 4 May 2019 14:27:23 +0100")

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





  reply	other threads:[~2019-05-04 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 13:27 bug#35562: "varset" bytecode inline path is never taken Simon Frankau
2019-05-04 16:10 ` Noam Postavsky [this message]
2019-05-04 18:16 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y33mmc9n.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=35562@debbugs.gnu.org \
    --cc=sgf@arbitrary.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.