Click here to show or hide the menubar.

Home >  Archive >  2010 >  September >  9

Previous / Next

Hash function performance
By Dave Winer on Thursday, September 09, 2010 at 3: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. permalink

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.  permalink

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. permalink

0: 14,792 permalink

1: 3,840 permalink

2: 9,629 permalink

3: 8,440 permalink

4: 15,368 permalink

5: 11,306 permalink

6: 7,561 permalink

7: 17,605 permalink

8: 13,074 permalink

9: 13,651 permalink

10: 9,815 permalink

This looks pretty random to us. permalink

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

RSS feed for Scripting News
This site contributes to the scripting.com community river.


© Copyright 1997-2012 Dave Winer. Last update: Thursday, September 09, 2010 at 3:04 PM Eastern. Last build: 8/26/2012; 5:55:55 PM. "It's even worse than it appears."

RSS feed for Scripting News

Previous / Next