all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 66816@debbugs.gnu.org
Subject: bug#66816: [PATCH] Delete redundant lambdas around unary functions
Date: Sun, 29 Oct 2023 20:03:16 +0100	[thread overview]
Message-ID: <1F4EC90D-4A07-4B24-B699-5AC1CC6A8408@gmail.com> (raw)
In-Reply-To: <CADwFkmmvSJuoJrnAPnLWhr-LRmGHk9=XjpqNi-mD=00iEQs=sA@mail.gmail.com>

> I've been able to measure around 10% better performance in the few cases
> I looked into.  Here's an example:
> 
>     (benchmark-run 1000
>       (seq-filter (lambda (n) (bufferp n))
>                   (number-sequence 0 100000)))

(This would be less of a problem if we could inline functions on the Lisp level...)

We could also have the compiler η-reduce automatically. I investigated this very briefly some time ago. Maybe I can dig up the patch.

One problem is that the arity isn't necessarily preserved. Most of the time this isn't a problem but it could be something to watch out for if doing the η-reduction by hand.







  reply	other threads:[~2023-10-29 19:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 13:02 bug#66816: [PATCH] Delete redundant lambdas around unary functions Stefan Kangas
2023-10-29 19:03 ` Mattias Engdegård [this message]
2023-10-29 21:55   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-30  8:56     ` Mattias Engdegård
2023-10-30 15:00       ` Mattias Engdegård

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=1F4EC90D-4A07-4B24-B699-5AC1CC6A8408@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=66816@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefankangas@gmail.com \
    /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.