From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: obarray confusion
Date: Fri, 29 Oct 2010 12:46:07 +0200 [thread overview]
Message-ID: <878w1h5lao.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: 87aalxjoj4.fsf@lola.goethe.zz
David Kastrup <dak@gnu.org> writes:
> 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.
Obviously, emacs is optimized for editing, not for compiling ;-)
I agree that the size of the obarray should adapt to its content.
--
__Pascal Bourguignon__ http://www.informatimago.com/
next prev parent reply other threads:[~2010-10-29 10:46 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
2010-10-29 10:46 ` Pascal J. Bourguignon [this message]
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=878w1h5lao.fsf@kuiper.lan.informatimago.com \
--to=pjb@informatimago.com \
--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).