From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] What's the quickest way to contribute? Date: Tue, 13 Jan 2015 14:24:50 -0500 Message-ID: References: <54B4899B.8010004@yandex.ru> <54B4FE6E.4070600@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421177159 30131 80.91.229.3 (13 Jan 2015 19:25:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Jan 2015 19:25:59 +0000 (UTC) Cc: Oleh Krehel , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 13 20:25:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YB767-0003UM-BW for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2015 20:25:51 +0100 Original-Received: from localhost ([::1]:41050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB766-0007H7-R4 for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2015 14:25:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB75a-0007C4-Cv for emacs-devel@gnu.org; Tue, 13 Jan 2015 14:25:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YB75W-0004au-2Z for emacs-devel@gnu.org; Tue, 13 Jan 2015 14:25:18 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:37994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB75V-0004aj-Vg for emacs-devel@gnu.org; Tue, 13 Jan 2015 14:25:14 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id B46D185D72; Tue, 13 Jan 2015 14:25:13 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id B1EB41E5B8D; Tue, 13 Jan 2015 14:24:50 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 926CAB4102; Tue, 13 Jan 2015 14:24:50 -0500 (EST) In-Reply-To: <54B4FE6E.4070600@yandex.ru> (Dmitry Gutov's message of "Tue, 13 Jan 2015 14:15:58 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181228 Archived-At: >> I think algorithmically, it's equivalent (both are O(N), basically). > On some inputs, `cl-remove-if-not' could save on memory churn (less consing > in the process), if the result list is small. Or if there's nothing to > remove: it will simply return the original list. Yes, they don't have quite the same efficiency both in terms of number of instructions and memory use. Still makes no difference "algorithmically" (i.e. still O(N)). And my guess is still that in practice it will be a wash (even for specially crafted benchmarks, I'd expect the performance to be very similar, based on my past experience trying to use compiler-macros to turn mapcar into dolist). Stefan