[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: |
John Wiegley |
Subject: |
Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el |
Date: |
Thu, 11 Aug 2016 10:34:01 -0700 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.95 (darwin) |
>>>>> "SM" == Stefan Monnier <address@hidden> 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
- Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el, (continued)
- Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el, Mark Oteiza, 2016/08/10
- Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el, Richard Stallman, 2016/08/11
- Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el, Stefan Monnier, 2016/08/12
- [PATCH] lexical-binding mega-patch (was: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el), Mark Oteiza, 2016/08/13
- Re: [PATCH] lexical-binding mega-patch (was: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el), Eli Zaretskii, 2016/08/13
- Re: [PATCH] lexical-binding mega-patch, John Wiegley, 2016/08/14
- Re: [PATCH] lexical-binding mega-patch, Mark Oteiza, 2016/08/14
- Re: [PATCH] lexical-binding mega-patch (was: Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el), Chad Brown, 2016/08/13
Re: [Emacs-diffs] master 05dc679: Turn on lexical-binding in json.el,
John Wiegley <=