From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: Re: Does anyone have a better scm_string_hash ? Date: Fri, 14 Nov 2003 21:09:26 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <874qx6emq1.fsf@alice.rotty.yi.org> References: <1068833495.13117.57.camel@localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068840724 22229 80.91.224.253 (14 Nov 2003 20:12:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2003 20:12:04 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Nov 14 21:12:00 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKkIS-0003fx-00 for ; Fri, 14 Nov 2003 21:12:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKlFE-0007Ri-Df for guile-devel@m.gmane.org; Fri, 14 Nov 2003 16:12:44 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AKlE8-0007CD-Ki for guile-devel@gnu.org; Fri, 14 Nov 2003 16:11:36 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AKlDU-0006T8-Fn for guile-devel@gnu.org; Fri, 14 Nov 2003 16:11:27 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.24) id 1AKlDS-0006Pk-9V for guile-devel@gnu.org; Fri, 14 Nov 2003 16:10:54 -0500 Original-Received: (qmail 28464 invoked by uid 65534); 14 Nov 2003 20:09:28 -0000 Original-Received: from chello213047125140.14.univie.teleweb.at (EHLO garibaldi) (213.47.125.140) by mail.gmx.net (mp021) with SMTP; 14 Nov 2003 21:09:28 +0100 X-Authenticated: #3102804 Original-Received: from ivanova.rhinosaur.lan ([192.168.1.9] helo=ivanova) by garibaldi with esmtp (Exim 4.24) id 1AKkFy-0003cm-U4; Fri, 14 Nov 2003 21:09:26 +0100 Original-Received: from andy by ivanova with local (Exim 3.36 #1 (Debian)) id 1AKkFy-0004kT-00; Fri, 14 Nov 2003 21:09:26 +0100 Original-To: Roland Orre In-Reply-To: <1068833495.13117.57.camel@localhost> (Roland Orre's message of "Fri, 14 Nov 2003 19:11:35 +0100") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3020 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3020 Roland Orre writes: > A hash table in this case was loaded with 14166 strings. I have > a function which creates a reasonable sized hash table, in this > case the hash table size was 8209. > > 13856 of these strings were hashed to the same index= 1067. > 303 strings got index = 8061. > 2 strings got the index = 754. > 8201 entries were empty. > > We are running guile 1.6 but I checked the scm_string_hash from a recent > 1.7 CVS also and the function in hash.c there is identical. > > I added a few of the symbols hashing to 1067 below. One can of course > argue that the symbols in this case should be hashed as numbers. > Anyway, does anyone have any hint or have a better string hash function? > Maybe have a look at how g_str_hash (from GLib) does it. Gtx, Andi -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62 This reality is really just a fucked-up dream -- Papa Roach _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel