chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] hash-tables


From: Felix Winkelmann
Subject: Re: [Chicken-users] hash-tables
Date: Mon, 24 Nov 2003 07:29:31 +0100
User-agent: Opera7.21/Win32 M2 build 3218

Am Sun, 23 Nov 2003 14:19:11 +0100 hat address@hidden <address@hidden> geschrieben:

A couple of questions about hash-tables:

1) Should I use hash-tables or associative lists if performance is important? How do they
    compare?

For short data-sets an association-list will likely be more efficient.
Since Chicken uses a copying garbage-collector, one cannot (unfortunately)
just take the address of an object in the heap and use that as a hash-code
(which would be damn fast), so the hash-code has to be computed from
the contents of the data. Actually, I exclusively use a-lists, unless
I know it's going to be a big table. Doing some benchmarking for your
particular application might be worthwhile.

2) I see in the manual that "get" and "put!" can have a "property" argument; what's that?


The property may be anything, but it will be compared using `eq?'.
(yes, that should be documented... ;-)


cheers,
felix




reply via email to

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