[Top][All Lists]

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

Re: performance of converting alist to hash table

From: Andreas Schwab
Subject: Re: performance of converting alist to hash table
Date: Sun, 16 May 2004 16:02:00 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

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 Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

reply via email to

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