From: David Kastrup <dak@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: obarray confusion
Date: Fri, 29 Oct 2010 12:12:31 +0200 [thread overview]
Message-ID: <87aalxjoj4.fsf@lola.goethe.zz> (raw)
In-Reply-To: 87sjzr8boe.fsf@kuiper.lan.informatimago.com
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
next prev parent reply other threads:[~2010-10-29 10:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 21:21 obarray confusion Sean McAfee
[not found] ` <87sjzr8boe.fsf@kuiper.lan.informatimago.com>
2010-10-29 10:12 ` David Kastrup [this message]
2010-10-29 10:46 ` Pascal J. Bourguignon
2010-10-29 19:00 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aalxjoj4.fsf@lola.goethe.zz \
--to=dak@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).