emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el


From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el
Date: Thu, 11 Aug 2016 16:35:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]