From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: obarray confusion Date: Fri, 29 Oct 2010 12:46:07 +0200 Organization: Informatimago Message-ID: <878w1h5lao.fsf@kuiper.lan.informatimago.com> References: <87sjzr8boe.fsf@kuiper.lan.informatimago.com> <87aalxjoj4.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291882565 26604 80.91.229.12 (9 Dec 2010 08:16:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 08:16:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 09:16:01 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQbfS-0005qc-Fx for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 09:15:58 +0100 Original-Received: from localhost ([127.0.0.1]:40362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQbfR-0003dw-Hl for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 03:15:57 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: individual.net qnl1b+H8B44/b6OiRifmtw9yjwXIRV1Yi0EVgpRuOUmUZByFjJ Cancel-Lock: sha1:Yzc2OTE2ZWE3OGYxNmQ0M2I3MTZiMTBlNDQxZmU2OGFlY2IyMDQ0YQ== sha1:O9SuH/NXD9jEm9JxiOcLq4PgFHc= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:182106 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76864 Archived-At: David Kastrup writes: > pjb@informatimago.com (Pascal J. Bourguignon) writes: > >> Sean McAfee 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/