From: Stefan Monnier <monnier@iro.umontreal.ca>
To: alinsoar@voila.fr
Cc: "Emacs Dev \[emacs-devel\]" <emacs-devel@gnu.org>
Subject: Re: van Emde Boas hash.
Date: Mon, 23 Nov 2009 11:43:25 -0500 [thread overview]
Message-ID: <jwv7hth5h1i.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <24616604.12772711258985081474.JavaMail.www@wwinf4633> (A. Soare's message of "Mon, 23 Nov 2009 15:04:41 +0100 (CET)")
> As far as I understand, the algorthm is so:
> oblookup ( obarray, sym )
> ;; hash is an integer, the index of a bucket that may contain sym
> hash = hash_string (sym)
> ;; bucket is a vector. obarray is a vector of many buckets
> bucket = obarray [hash]
> ;; search sym in its bucket using a naive search
> FOR every symbol S in bucket, check whether S has the same name
> as sym. If so, return S. If no symbol matches, returns the hash.
> Even if it is very unlikely that we can find many symbols into
> a bucket, the algorithm does not require constant time for
> every search.
Yes, it's a very simple hashing algorithm. I'm sure we can come up with
something more efficient. Then again, I haven't seen any indication
that this is a performance problem.
Stefan
next prev parent reply other threads:[~2009-11-23 16:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-23 14:04 van Emde Boas hash A. Soare
2009-11-23 16:43 ` Stefan Monnier [this message]
2009-11-23 16:57 ` David Kastrup
2009-11-27 9:04 ` A Soare
-- strict thread matches above, loose matches on Subject: below --
2009-11-27 18:01 A. Soare
2009-11-22 12:35 A. Soare
2009-11-23 2:25 ` Stefan Monnier
2009-11-20 6:41 A. Soare
2009-11-23 4:06 ` tomas
2009-11-23 14:39 ` A Soare
2009-11-19 12:04 A. Soare
2009-11-19 15:23 ` Stefan Monnier
2009-11-19 16:44 ` Deniz Dogan
2009-11-27 9:14 ` A Soare
2009-11-27 16:56 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv7hth5h1i.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=alinsoar@voila.fr \
--cc=emacs-devel@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.