From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: performance of converting alist to hash table Date: Mon, 17 May 2004 13:43:41 -0400 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <4n3c5zj6eq.fsf@lifelogs.com> References: <20040516095522.GA1625@SDF.LONESTAR.ORG> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084823352 8560 80.91.224.253 (17 May 2004 19:49:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 May 2004 19:49:12 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 17 21:48:57 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BPo6b-0000Ca-00 for ; Mon, 17 May 2004 21:48:57 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BPo6b-0003bw-00 for ; Mon, 17 May 2004 21:48:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BPnmZ-0007V9-GT for emacs-devel@quimby.gnus.org; Mon, 17 May 2004 15:28:15 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BPnlQ-0007M4-Ao for emacs-devel@gnu.org; Mon, 17 May 2004 15:27:04 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BPmPP-0007au-Ux for emacs-devel@gnu.org; Mon, 17 May 2004 14:00:48 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BPmPI-0007ZY-Te for emacs-devel@gnu.org; Mon, 17 May 2004 14:00:14 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BPmPH-0004rA-00 for ; Mon, 17 May 2004 20:00:07 +0200 Original-Received: from asimov.bwh.harvard.edu ([134.174.9.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 May 2004 20:00:07 +0200 Original-Received: from tzz by asimov.bwh.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 May 2004 20:00:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 25 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: asimov.bwh.harvard.edu X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:+zn7dHTCTyXRNAcAM5wn4BtwhEU= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23595 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23595 On Sun, 16 May 2004, daiyuwen@sdf.lonestar.org wrote: > I'm trying to convert a large alist(nearly 7000 elements in it) to a > hash table. But I found the performence of my function is poor: on a > Celeron 333MHz, 196M memory system, it'll take 15 seconds to finish > converting. I use this function in the Gnus gnus-registry.el code: (defun alist-to-hashtable (alist) "Build a hashtable from the values in ALIST." (let ((ht (make-hash-table :size 4096 :test 'equal))) (mapc (lambda (kv-pair) (puthash (car kv-pair) (cdr kv-pair) ht)) alist) ht)) It loads my 5000-entry registry alist quickly even on a relatively slow (UltraSPARC-IIe 650 MHz) processor. Is it slow for you? Maybe the equality test you are using is too slow? Ted