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: Adrian Aichner
Subject: Re: performance of converting alist to hash table
Date: Sun, 16 May 2004 17:51:07 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, windows-nt)

Andreas Schwab <address@hidden> writes:

> Dai Yuwen <address@hidden> writes:
>
>> I use `mapc' like this:
>> (defun convert-alist-to-hash (table  w)
>>   (mapc (lambda (e)
>>           (puthash (car e) (cadr e) table))
>>         w))
>>
>> Almost the same time needed. (I made a mistake in the previous email, it 
>> should be 30 seconds instead of 15.) 
>
> How did you create the hash table?  You should probably start with a
> larger hash table than the default to avoid too many resize operations.
>
> Andreas.

Here's what I get for
M-x profile-sexp RET (convert-alist-to-hash (make-hash-table :size 70000) 
a-list)

based on these definitions:

Attachment: convert-alist-to-hash.el
Description: application/emacs-lisp

Profiling results on a Dell C600 with 850MHz:

Attachment: txtpQ0E7KYhXC.txt
Description: Text document

-- 
Adrian Aichner
 mailto:address@hidden
 http://www.xemacs.org/

reply via email to

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