From: Alexandre F. <ale...@gm...> - 2013-01-10 10:51:11
|
On Thu, Jan 10, 2013 at 11:35 AM, Martin Lemburg <mar...@gm...> wrote: > Hi, > > via the Codeproject Daily newsletter I got in touch with the following hash > table benchmark articel: > > > http://www.codeproject.com/News.aspx?ntag=19837497437284805&_z=0391382 > > > The author really would like to know details from under the hood to > understand why tcl 8.5 is so "unbeatable" in its hash table performance. > Any one there able to explain him? Two obvious things: (1) IIUC, the test keys are random digit strings. This is a "sweet spot" by design for Tcl's hash, because of the ubiquity of integer indices in typical programs (IOW, the hash function is nearly injective for digit strings). This may not be the case of the other languages' hashes. (2) To analyze such things, it is good to separate algorithmic performance from implementation. For the former, compute an histogram of bucket depths. The latter should only be done iso-hashfunction. -Alex |