[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: obarray confusion
From: |
David Kastrup |
Subject: |
Re: obarray confusion |
Date: |
Wed, 08 Dec 2010 15:33:51 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
pjb@informatimago.com (Pascal J. Bourguignon) writes:
> Sean McAfee <eefacm@gmail.com> writes:
>
>> (mapatoms (lambda (s) (incf n))) tells me I have 43061 symbols defined.
>> (length obarray) tells me the standard obarray has a size of 1511.
>>
>> My understanding is that an obarray is essentially a hash table with
>> collision chaining. But this would mean that the linked list of symbols
>> in each bucket has an average length of 43061 / 1511 ≈ 28.
>>
>> Emacs's symbol lookup couldn't possibly be that inefficient, could it?
>
> Symbols are interned only when they are read, which doesn't occur often.
28 is quite the bucket size. If the average bucket size is larger than
1 for the dumped Emacs already, that's just a case of bad defaults, and
of course it should affect byte compilation times quite a bit.
--
David Kastrup