From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: performance of converting alist to hash table Date: 16 May 2004 13:18:07 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040516095522.GA1625@SDF.LONESTAR.ORG> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1084702838 15505 80.91.224.253 (16 May 2004 10:20:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 May 2004 10:20:38 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 16 12:20:32 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 1BPIky-0004ys-00 for ; Sun, 16 May 2004 12:20:32 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BPIkx-0006eF-00 for ; Sun, 16 May 2004 12:20:31 +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 1BPIjL-0004Js-I2 for emacs-devel@quimby.gnus.org; Sun, 16 May 2004 06:18:51 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BPIif-0004H4-Ko for emacs-devel@gnu.org; Sun, 16 May 2004 06:18:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BPIgk-0003GM-Fm for emacs-devel@gnu.org; Sun, 16 May 2004 06:16:50 -0400 Original-Received: from [207.232.27.5] (helo=WST0035) by monty-python.gnu.org with asmtp (Exim 4.34) id 1BPIgi-0003Dl-EN; Sun, 16 May 2004 06:16:09 -0400 Original-To: Dai Yuwen In-reply-to: <20040516095522.GA1625@SDF.LONESTAR.ORG> (message from Dai Yuwen on Sun, 16 May 2004 09:55:22 +0000) 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:23525 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23525 > Date: Sun, 16 May 2004 09:55:22 +0000 > From: Dai Yuwen > > 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. > > This is the function: > > (defun convert-alist-to-hash (table w) > (let ((l w)) > (while l > (setq char (car (car l)) > key (car (cdr (car l))) > l (cdr l)) > (puthash char key table)))) Did you try `mapcar' and its variants?