all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Nicolas Petton <nicolas@petton.fr>, emacs-devel@gnu.org
Subject: Re: [PATCH] extend map-into
Date: Tue, 08 Oct 2019 18:46:06 +0000	[thread overview]
Message-ID: <xjf36g3jcsx.fsf@sdf.org> (raw)
In-Reply-To: <jwv7e5fywpy.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 08 Oct 2019 13:29:32 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> I guess we could use a `type` that's not a symbol but a list (whose
>>> head is a symbol and the rest are the args), but it could be a bit
>>> inconvenient (and would impact efficiency as well because it makes the
>>> cl-generic dispatch more complex).
>> Cool, is the attached patch doing what you suggest?
>
> Yes.  Have you taken a look at the performance impact?
> E.g. how much slower does something like (map-into nil 'alist) becomes
> (this should be pretty the worst case which spends most/all its time in
> the dispatch)?

I can tell you what I did just now and you tell me if it makes sense.
I've created a function with as body an unrolled loop that calls 10000
times (map-into nil 'alist).
Once byte compiled I've run it with the current map.el and then with the
new one loaded.
On my machine both versions runs in about the same time (~0.04-0.03
secs), if there's some difference for this simple test is just noise.

Interesting, I would bet on funcall as responsible but I admit I don't
know how the dynamic dispatch is implemented in details.

> Nicolas, WDYT?
>
>
>         Stefan

Bests
  Andrea

-- 
akrl@sdf.org



  reply	other threads:[~2019-10-08 18:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  9:58 new function proposal alist-to-hash Andrea Corallo
2019-10-04 19:16 ` Stefan Monnier
2019-10-05  8:18   ` Andrea Corallo
2019-10-05 15:13     ` Stefan Monnier
2019-10-05 15:45       ` Andrea Corallo
2019-10-05  8:28   ` [PATCH] extend map-into (was: new function proposal alist-to-hash) Andrea Corallo
2019-10-06 14:02     ` [PATCH] extend map-into Stefan Monnier
2019-10-06 20:59       ` Andrea Corallo
2019-10-08 17:29         ` Stefan Monnier
2019-10-08 18:46           ` Andrea Corallo [this message]
2019-10-08 20:23             ` Stefan Monnier
2019-10-09 15:35               ` Andrea Corallo
2019-10-09 19:41                 ` Stefan Monnier
2019-10-09 20:02                   ` Andrea Corallo
2019-10-10  8:27                     ` Nicolas Petton
2019-10-10  8:28                     ` Nicolas Petton
2019-10-10 10:06                       ` Andrea Corallo
2019-10-10 11:47                         ` Nicolas Petton
2019-10-11 16:19                         ` Stefan Monnier
2019-10-11 16:29                           ` Andrea Corallo

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=xjf36g3jcsx.fsf@sdf.org \
    --to=akrl@sdf.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nicolas@petton.fr \
    /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.