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

Re: break even point between hash tables and lists



Dan Stanger <dxs@evolving.com> asks:

> what is the number of elements that causes hash tables to be more
> efficient than a list for storing and retrieving data?

There was a discussion about this in comp.lang.lisp a couple of months ago.
For speed, the break-even point (comparing ASSOC to GETHASH) depends much
on the Lisp implementation: for some implementations it is about 200 elements,
for CLISP it is 2 or 3 elements. For space, however: lists are always more
compact.


                    Bruno Haible
                    haible@ma2s2.mathematik.uni-karlsruhe.de