emacs-devel
[Top][All Lists]
Advanced

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

Re: [patch] generator function optimizations


From: Stefan Monnier
Subject: Re: [patch] generator function optimizations
Date: Sun, 12 Mar 2017 13:21:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> In my real code (a very large function used as a co-routine)
> with 60 yields, generator function has over 1000 lambdas.
> I see several ways to improve this at least somewhat.
>
> The patch below improves transformation of `progn' forms.
> Here it results in 30 lambdas in the generator function fewer.
> Not great (~ -3%), but I guess in other cases it can give a
> larger improvement.

Hmm... I don't think anyone should really care about the number of
lambdas, right?  So what is the actual problem (caused by this large
number of lambdas) that you're trying to improve?  Code size?
Run time?  Both?  Something else?

Have you tried to measure the impact of your patch on the actual problem?

> If this patch is accepted, I can work on some other ideas
> I have.

Indeed, there's probably a lot of opportunity for improvement.
E.g. cconv.el was designed based on the assumption that there wouldn't
be many different lambdas within the same scope (i.e. we don't try to
share the data part of various related closures).


        Stefan




reply via email to

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