[erlang-questions] Dict size in guards

ok <>
Mon Feb 14 05:16:10 CET 2011

> On Fri, Feb 11, 2011 at 06:40:12PM +0900, Michael Turner wrote:
>> FWIW, Doug Clark found that the average length of lists in large, mature
>> lisp applications was about four.
> 1. As far as I remember, LISP programs don't typically manage strings
> of characters as lists of small integers.
> 2. LISP doesn't have tuples, so things that in Erlang are usually
> tuples are represented in LISP as small lists.
> The one makes average Erlang lists longer, and the other makes average
> LISP lists smaller.

I suspect that this is the study behind the "CDR coding" paper,
which was based on 'five large Lisp programs (about 50,000 cells each)'.
This goes back to the era when a DECsystem-10 with 250 kilowords
(about 1.25 MB in today's terms, although it could give you very nearly
200k cons cells, the _effective_ equivalent of 1.6MB) was a mainframe
and a Xerox 1108 running Interlisp with 4 MB of memory was huge
(and a 24-bit address space and 8 bit CDR field gave you 4 byte
cons cells).

Since then, things have changed a lot.  We have and we use a LOT more
memory.  We expect to fit a lot more data in.
(HEAP-UTILIZATION) in a quiescent Clozure Common Lisp --- none of my
own code loaded --- says there are 293679 cons cells, but says nothing
about how long the lists are.  I note that a modern Lisp with NO user
program in it has more cons cells than classic DEC-10 Lisps could
hold when full.

For comparison, I just took a quiescent Squeak 3.10 system and did
|n d|
n := d := 0.
Array allInstances do: [:each | n := n + each size. d := d + 1].
n / d asFloat
and got an average Array size of a whisker under 12.

Using 'String allSubInstancesDo:' instead gave me an average string
size of a whisker over 30.

Anyone have Lisp figures that *aren't* obsolete?

More information about the erlang-questions mailing list