all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vibhav Pant <vibhavp@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
Date: Thu, 19 Jan 2017 17:53:50 +0000	[thread overview]
Message-ID: <CA+T2Sh1sv482AJ0Nm-JHJQqMjAF+XSG6fyBQJxcOj=ifTRXy+w@mail.gmail.com> (raw)
In-Reply-To: <jwvd1fjau78.fsf-monnier+emacsdiffs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

I see. For now, I've made the type check only work when BYTE_CODE_SAFE is
defined at compile time. I'll make it a part of the regular code once the
byte-switch is implemented and there are no performance issues with doing
so.

On Thu, 19 Jan 2017, 22:04 Stefan Monnier, <monnier@iro.umontreal.ca> wrote:

> > On another thought, `byte-switch` is used while compiling certain
> > `cond` forms. It
> > replaces the traditional goto-if-nil bytecode by using a hash table
> mapping
> > values to addresses/tags to be jumped to. Since `byte-switch` is
> essentially a
> > "dynamic" goto (in the sense that the address/tag cannot be known at
> > compile time),
> > wouldn't doing a runtime type check in the bytecode VM for what is  a
> > hash table lookup + goto have a significant performance penalty?
>
> I don't know.  Only measurement can tell.  My guess is that hash_lookup
> already takes a significant amount of time, so a HASH_TABLE_P test would be
> negligible in comparison.
>
>
>         Stefan
>
>
> > On Wed, Jan 18, 2017 at 11:18 PM, Stefan Monnier
> > <monnier@iro.umontreal.ca> wrote:
> >>> * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
> >>> Fgethash type checks the provided table object, which is unnecessary
> >>> for compiled bytecode.
> >>
> >> While it's true that we can cause a core dump of Emacs if we feed it an
> >> invalid .elc file, that's a "feature" I'd rather shrink rather
> >> than generalize.
> >>
> >>
> >> Stefan
>
>
>
> > --
> > Vibhav Pant
> > vibhavp@gmail.com
>

[-- Attachment #2: Type: text/html, Size: 2819 bytes --]

  reply	other threads:[~2017-01-19 17:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170118171311.10996.72260@vcs.savannah.gnu.org>
     [not found] ` <20170118171311.A84EA220125@vcs.savannah.gnu.org>
2017-01-18 17:48   ` [Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch Stefan Monnier
2017-01-18 18:19     ` Vibhav Pant
2017-01-19 12:16     ` Vibhav Pant
2017-01-19 16:34       ` Stefan Monnier
2017-01-19 17:53         ` Vibhav Pant [this message]
2017-01-20  9:10     ` Daniel Colascione
2017-01-20 14:53       ` Stefan Monnier

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='CA+T2Sh1sv482AJ0Nm-JHJQqMjAF+XSG6fyBQJxcOj=ifTRXy+w@mail.gmail.com' \
    --to=vibhavp@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.