emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performance of converting alist to hash table


From: Dai Yuwen
Subject: Re: performance of converting alist to hash table
Date: Wed, 19 May 2004 12:02:02 +0000
User-agent: Mutt/1.4.2.1i

On Tue, May 18, 2004 at 02:23:46PM +0200, David Kastrup wrote:
> Dai Yuwen <address@hidden> writes:
> 
> > Dear all,
> > 
> > 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))))
> > 
> > And how I call the function:
> > 
> > (convert-alist-to-hash ta 
> > '(("w1" "aaaa")
> > ("w2" "aa")
> > ("w3" "aak")
> > ...))
> 
> Did you byte-compile the function?
No matter whether I compiled the function or not, the result almost the same.

> 
-- 
address@hidden
SDF Public Access UNIX System - http://sdf.lonestar.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]