help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: obarray confusion


From: Pascal J. Bourguignon
Subject: Re: obarray confusion
Date: Wed, 08 Dec 2010 15:33:44 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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.

But if you want a more efficient lisp, have a look at Common Lisp.
(and there are various emacsen written in Common Lisp, from Portable
Hemlock to Climacs).

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


reply via email to

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