Rjudy & Ruby 1.8.0;

Hi,

I just now looked at rjudy-1.0 and Ruby 1.8.0.

It looks as if the Hash implementation in Ruby 1.8.0 is good :-).

I generate a 3.3 MB junk file:
for i in 1…500000
puts i end

Then I run
ruby words.rb /tmp/junk
(words.rb is from rjudy-1.0/examples)
and get:

*** Insertion Times for 500000 words ***

Rehearsal ---------------------------------------------
nothing 0.090000 0.000000 0.090000 ( 0.095862)
JudySL: 0.970000 0.000000 0.970000 ( 1.061875)
JudyHash: 2.370000 0.000000 2.370000 ( 3.372323)
Hash: 1.950000 0.000000 1.950000 ( 2.068053)
------------------------------------ total: 5.380000sec

            user     system      total        real

nothing 0.090000 0.000000 0.090000 ( 0.089337)
JudySL: 0.860000 0.000000 0.860000 ( 0.864048)
JudyHash: 0.860000 0.000000 0.860000 ( 0.899812)
Hash: 0.770000 0.000000 0.770000 ( 0.773548)

*** Lookup Times for 500000 words ***

Rehearsal ---------------------------------------------
nothing 0.090000 0.000000 0.090000 ( 0.092045)
JudySL: 0.720000 0.000000 0.720000 ( 0.741567)
JudyHash: 0.800000 0.000000 0.800000 ( 0.825403)
Hash: 0.630000 0.000000 0.630000 ( 0.664867)
------------------------------------ total: 2.240000sec

            user     system      total        real

nothing 0.100000 0.000000 0.100000 ( 0.097878)
JudySL: 0.720000 0.000000 0.720000 ( 0.726573)
JudyHash: 0.770000 0.000000 0.770000 ( 0.773717)
Hash: 0.630000 0.000000 0.630000 ( 0.634579)

Thanks,
-A.

···

Armin Roehrl, http://www.approximity.com
We manage risk

By default it uses the SDBM hash algorithmn also used by Berkley DB.
It's really one of the best available if my measures aren't wrong
(http://www.fantasy-coders.de/projects/gh/html/x435.html\).

But it's the same as in Ruby 1.6.8.

Regards,

  Michael

···

On Sat, Aug 09, 2003 at 07:39:34AM +0900, Armin Roehrl wrote:

Hi,

  I just now looked at rjudy-1.0 and Ruby 1.8.0.
It looks as if the Hash implementation in Ruby 1.8.0 is good :-).

By default it uses the SDBM hash algorithmn also used by Berkley DB.

Well, this is not important but not really : if I'm right Berkeley DB use
Fowler/Noll/Vo hash or Chris Torek's hash function (it depend on the hash
version) and not Ozan Yigit's original sdbm hash

Guy Decoux

Hm, this is probably true for newer versions of BDB. Looking at 1.85
there's still SDBM in the code (as well as some other functions, e.g. Torek's).
If it's used, I don't know. Maybe it's better to say "was used by BDB".

Regards,

  Michael

···

On Sat, Aug 09, 2003 at 09:28:12PM +0900, ts wrote:

> By default it uses the SDBM hash algorithmn also used by Berkley DB.

Well, this is not important but not really : if I'm right Berkeley DB use
Fowler/Noll/Vo hash or Chris Torek's hash function (it depend on the hash
version) and not Ozan Yigit's original sdbm hash

Hm, this is probably true for newer versions of BDB. Looking at 1.85
there's still SDBM in the code (as well as some other functions, e.g. Torek's).

yes, the hash version actually is 5 and use FNV. sdbm hash was for version
3, Torek' version for 4

If it's used, I don't know. Maybe it's better to say "was used by BDB".

Perhaps best to call it Berkeley DB to don't make confusion with bdb :-)))

Guy Decoux