Rjudy & Ruby 1.8.0;

A

Armin Roehrl

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

ts

M> 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
 
M

Michael Neumann

M> 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).
If it's used, I don't know. Maybe it's better to say "was used by BDB".

Regards,

Michael
 
T

ts

M> Hm, this is probably true for newer versions of BDB. Looking at 1.85
M> 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

M> 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,246
Latest member
TemekaLutz

Latest Threads

Top