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: David Kastrup
Subject: Re: performance of converting alist to hash table
Date: 18 May 2004 14:23:46 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

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?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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