all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Mark Oteiza <mvoteiza@udel.edu>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el
Date: Thu, 11 Aug 2016 10:34:01 -0700	[thread overview]
Message-ID: <m2oa4zdxbq.fsf@newartisans.com> (raw)
In-Reply-To: <jwvwpjoljak.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Wed, 10 Aug 2016 11:45:51 -0400")

>>>>> "SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes:

SM> I think it's the first time I see lexical-binding used for performance ;-)

I really think this is an untapped area for optimization.

When I did aggressive profiling, I found that up to 40% of evaluation was
spent repeatedly looking up variables -- even those local to the function --
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. 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.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



  parent reply	other threads:[~2016-08-11 17:34 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 [this message]
2016-08-11 20:35       ` Stefan Monnier
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

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

  git send-email \
    --in-reply-to=m2oa4zdxbq.fsf@newartisans.com \
    --to=jwiegley@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=mvoteiza@udel.edu \
    /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.