From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Some new vector procedures (vector-{memq, apply, to-string, ...}) Date: Sun, 21 Apr 2019 00:05:25 -0400 Message-ID: References: <8736md90v0.fsf@gmail.com> <83lg05b1jk.fsf@gnu.org> <87lg047h9n.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="252231"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 21 06:06:13 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hI3k5-0013UR-G6 for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2019 06:06:13 +0200 Original-Received: from localhost ([127.0.0.1]:48557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI3k4-0005Wl-Cz for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2019 00:06:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI3jV-0005WQ-S3 for emacs-devel@gnu.org; Sun, 21 Apr 2019 00:05:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hI3jU-0007JC-OY for emacs-devel@gnu.org; Sun, 21 Apr 2019 00:05:37 -0400 Original-Received: from [195.159.176.226] (port=55046 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hI3jU-0007Ia-Hs for emacs-devel@gnu.org; Sun, 21 Apr 2019 00:05:36 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hI3jS-0012jx-F7 for emacs-devel@gnu.org; Sun, 21 Apr 2019 06:05:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:nImllgyZvrqDsIfmKp521q9UEnI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:235724 Archived-At: > I don't see any replacement for vector-apply, but I admit that the worth > of that one might not be worth the change at this point. I'm not sure I like vector-apply, but I am interested in doing something along these lines for cl-generic: the use of wrappers of the form (lambda (x &rest args) ... (apply f x args)) proves to be too costly in some cases (e.g. cl-print). But the main issue seems to be the allocation of a new list for `args`, so `vector-apply` doesn't really help here. > For vector-memq, the Lisp implementations almost disallow it from being > used over memq/lists. I your `vector-memq` significantly faster than `memq`? My impression is that for small enough "sets", even if a bit faster, `vector-memq` wouldn't bring much benefit, and for larger sets if performance is an issue you'd likely prefer using a completely different structure such as a hash-table. Stefan