From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: cl position performances Date: Tue, 23 Feb 2010 10:30:08 +0100 Organization: ThierryVolpiatto Message-ID: <871vgc1eqn.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1266917715 8773 80.91.229.12 (23 Feb 2010 09:35:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Feb 2010 09:35:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 23 10:35:11 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NjrAd-00076p-6S for ged-emacs-devel@m.gmane.org; Tue, 23 Feb 2010 10:35:11 +0100 Original-Received: from localhost ([127.0.0.1]:39993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjrAc-0005BK-HM for ged-emacs-devel@m.gmane.org; Tue, 23 Feb 2010 04:35:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjrAU-0005A7-0i for emacs-devel@gnu.org; Tue, 23 Feb 2010 04:35:02 -0500 Original-Received: from [140.186.70.92] (port=39870 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjrAS-00059G-Q4 for emacs-devel@gnu.org; Tue, 23 Feb 2010 04:35:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NjrAS-0000Gx-4s for emacs-devel@gnu.org; Tue, 23 Feb 2010 04:35:00 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:57326) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjrAR-0000Gs-Po for emacs-devel@gnu.org; Tue, 23 Feb 2010 04:35:00 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NjrAP-0006zu-8t for emacs-devel@gnu.org; Tue, 23 Feb 2010 10:34:57 +0100 Original-Received: from 4.211.85-79.rev.gaoland.net ([79.85.211.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Feb 2010 10:34:57 +0100 Original-Received: from thierry.volpiatto by 4.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Feb 2010 10:34:57 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 4.211.85-79.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUHBARgJRFPS0WbMBTC TSG/uJs0yyVHAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABpUlE QVQ4y3VTQXKDMAyUnD7AwvQOhtxj5N4LFh9ow/+/UtlpM0BczWSS0Wola7UBeEb3+3kJ/5p9ZLz3 UI0n0J0Y4K/lh1nG24FhlJOR2LdSKtpV5gfi/Zd+NdaJBbB4D5N0JnfUIVp6obZURkJwS2a8b9uX AkgxA5gCEcknAH1s2z0DPooWmjGKcJR+HNZt+9bm0GtGRycRuZGs98Ffr02vABWGopIAhmXmxnQN BwBXZjgFLHRoqbfeYxCLWqsjLyKhbEHW+A5nEs699Q2O80ALrgHTmUTy6P0MnKyKQpKHpoNWokxs F0D5VegvWmEozyE6nuMiS98mWzlUQ9bW8qYfqOaFtzWlYCqGeIs6HEyl08jkrxUG9MF5ipXpOOpd ZMoXPPVSLWJiiwNNB+eRSyxJZmQKcacikgucnCRiHuJOLmyYJRDPwOqAvY4pA+Wy+VS8G26BAsdb Ph2Hw7ORy/H0IOG0TnaM8Cp0XrFYyU0v2z8AqkifPVbLZ0qo/gsRg60C7p+8Ov9jrUIxFde+jnAq X42hyp/c+ZcnVyUYBarrqZt3+R8450png3cWKgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAwOC0wNS0z MVQyMjoxNDoyMiswMjowMK3VBDcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDctMTAtMjhUMTc6MDg6 NDgrMDE6MDDLdIcLAAAAEXRFWHRqcGVnOmNvbG9yc3BhY2UAMix1VZ8AAAAgdEVYdGpwZWc6c2Ft cGxpbmctZmFjdG9yADJ4MiwxeDEsMXgxSfqmtAAAAABJRU5ErkJggg== User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) Cancel-Lock: sha1:Zg6qnaL36AG45LHJwXHjfb6iw8o= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121292 Archived-At: Hi, i wrote a very simple definition of `position' for use in traverselisp.el,(to avoid warnings) and i noticed that this is faster than the usual cl `position'. That can be interesting for very large list. ,---- | (defsubst* traverse-position (item seq &key (test 'eq)) | "A simple replacement of CL `position'." | (loop for i in seq for index from 0 | when (funcall test i item) return index)) `---- ,---- | ELISP> (position (bookmark-get-bookmark "mes_scripts") bookmark-alist) | 525 | ELISP> (traverse-position (bookmark-get-bookmark "mes_scripts") bookmark-alist) | 525 `---- ,---- | position 2 0.000817 0.0004085 | traverse-position 1 0.000283 0.000283 `---- Also, would be great all the (great) CL package be more integrated in elisp. Just an example: Try to get documentation of this same `position' function with C-h S. -- Thierry Volpiatto