Home >  Archive >  2010 >  September >  9

Previous / Next

Hash function performance
By Dave Winer on Thursday, September 09, 2010 at 4:04 PM.

It's been a long time since we looked at the object database in Frontier, so today Brent wrote a little app that checks out how the hash function distributes objects across the buckets for each table in the database. #

Here's how the function works. It takes the first and last characters of the name of the object, adds them together and mods the result by the number of buckets, which is 11.  #

As the OPML Editor started up it made 125,091 calls to the hash function, and the results were distributed among the buckets as follows. #

0: 14,792 #

1: 3,840 #

2: 9,629 #

3: 8,440 #

4: 15,368 #

5: 11,306 #

6: 7,561 #

7: 17,605 #

8: 13,074 #

9: 13,651 #

10: 9,815 #

This looks pretty random to us. #

If anyone reading this is an expert in hash function trivia, if you have an opinion, please chime in. #




Christmas Tree
This site contributes to the scripting.com community river.


© Copyright 1997-2011 Dave Winer. Last update: Thursday, September 09, 2010 at 4:04 PM Eastern. Last build: 12/12/2011; 12:45:39 PM. "It's even worse than it appears."

RSS feed for Scripting News

Previous / Next