From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] extend map-into Date: Tue, 08 Oct 2019 18:46:06 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="55958"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) Cc: Nicolas Petton , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 08 20:46:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHuV8-000EOH-CG for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2019 20:46:26 +0200 Original-Received: from localhost ([::1]:33414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHuV7-0005TR-5I for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2019 14:46:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41131) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHuUw-0005Rk-29 for emacs-devel@gnu.org; Tue, 08 Oct 2019 14:46:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHuUu-0000J5-Kv for emacs-devel@gnu.org; Tue, 08 Oct 2019 14:46:13 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:61017) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iHuUu-0000DC-Dr for emacs-devel@gnu.org; Tue, 08 Oct 2019 14:46:12 -0400 Original-Received: from sdf.org (IDENT:akrl@sverige.freeshell.org [205.166.94.5]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id x98Ik6h0006573 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Tue, 8 Oct 2019 18:46:06 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id x98Ik6M0009499; Tue, 8 Oct 2019 18:46:06 GMT In-Reply-To: (Stefan Monnier's message of "Tue, 08 Oct 2019 13:29:32 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240759 Archived-At: Stefan Monnier 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