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: [patch] generator function optimizations
Date: Sun, 12 Mar 2017 13:21:06 -0400	[thread overview]
Message-ID: <jwvefy2wh8e.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAG7BparaUdrZ0wAgn_AT2o0Vt1vSUf5NA1fbROfy=McgeqdNyw@mail.gmail.com

> 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	other threads:[~2017-03-12 17:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 10:59 [patch] generator function optimizations Paul Pogonyshev
2017-03-12 17:21 ` Stefan Monnier [this message]
2017-03-12 22:26 ` Andreas Politz
2017-03-12 22:33   ` Noam Postavsky
2017-03-12 22:44     ` Andreas Politz
  -- strict thread matches above, loose matches on Subject: below --
2017-03-12 19:12 Paul Pogonyshev
2017-03-12 21:53 ` 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=jwvefy2wh8e.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).