[Top][All Lists]
[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: |
Mon, 17 May 2004 01:18:03 +0000 |
User-agent: |
Mutt/1.4.2.1i |
On Sun, May 16, 2004 at 04:02:00PM +0200, Andreas Schwab wrote:
> 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.
>
I realized this. I created the hash table like this:
(setq ta (make-hash-table :test 'equal :size 7000))
and the actuaal length of the alist is 6727.
> Andreas.
>
> --
> 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."
--
address@hidden
SDF Public Access UNIX System - http://sdf.lonestar.org
- performance of converting alist to hash table, Dai Yuwen, 2004/05/16
- Re: performance of converting alist to hash table, Ted Zlatanov, 2004/05/17
- Re: performance of converting alist to hash table, Miles Bader, 2004/05/17
- Re: performance of converting alist to hash table, Dai Yuwen, 2004/05/18
- Re: performance of converting alist to hash table, Stefan Monnier, 2004/05/18
- Re: performance of converting alist to hash table, Dai Yuwen, 2004/05/19
- Re: performance of converting alist to hash table, Kenichi Handa, 2004/05/19
- Re: performance of converting alist to hash table, Dai Yuwen, 2004/05/26
- Re: performance of converting alist to hash table, Kenichi Handa, 2004/05/27
Re: performance of converting alist to hash table, David Kastrup, 2004/05/18