unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el
Date: Thu, 11 Aug 2016 16:35:45 -0400	[thread overview]
Message-ID: <jwvinv79hdq.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: m2oa4zdxbq.fsf@newartisans.com

> in order to support dynamic binding. With lexical scoping enabled, and in the
> absence of closures, it should be possible to fully localize such references
> so that no lookup is performed at all.

Lexical variables aren't stored in symbols's slots, but in the byte-code
stack.  So a variable access is an access to the (byte-code) stack with
a fixed offset.  Not sure how much faster that makes it, tho.

> I'm not sure whether the byte-compiler makes use of such an
> optimization, or if we even have a byte-code operand to support it,
> but my unsupported guestimate is that we could double performance in
> most areas by properly utilizing lexical binding.  Especially in tight
> loops that update/modify a local variable.

Lexical scoping does open up a fair bit of room for optimization,
indeed, and we haven't really tried to take advantage of it yet.


        Stefan




  reply	other threads:[~2016-08-11 20:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160810044910.10174.12870@vcs.savannah.gnu.org>
     [not found] ` <20160810044911.2B1C52201C2@vcs.savannah.gnu.org>
2016-08-10 15:45   ` [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el Stefan Monnier
2016-08-11  1:30     ` Mark Oteiza
2016-08-11  2:36       ` Stefan Monnier
2016-08-12 19:07         ` Stephen Berman
2016-08-12 19:43           ` Stefan Monnier
2016-08-13 18:18         ` [PATCH] lexical-binding mega-patch (was: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el) Mark Oteiza
2016-08-13 18:31           ` Eli Zaretskii
2016-08-14  6:32             ` [PATCH] lexical-binding mega-patch John Wiegley
2016-08-14 18:21               ` Mark Oteiza
2016-09-28 17:17             ` [PATCH] lexical-binding mega-patch (was: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el) Mark Oteiza
2016-09-29 15:21               ` Eli Zaretskii
2016-08-14  2:18           ` Chad Brown
2016-08-11  5:30       ` [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el Richard Stallman
2016-08-11 17:34     ` John Wiegley
2016-08-11 20:35       ` Stefan Monnier [this message]
2016-08-12  6:37         ` Eli Zaretskii
2016-08-12 12:41           ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvinv79hdq.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).