a benchmark of the D language's hash

since: 2003-10-01 update: 2003-10-01 count:

I use Tietew's work (post in cppll) and this D code.

(the same kind of benchmark already exists, but I think it may be benchmark of itoa, not hash.

Environment:

method: STL map (red-black tree)
total time: 0.3638165sec
insert: total 0.358733sec, avg 3.663232e-06sec/item
lookup: total 0.005083sec, avg 5.083500e-07sec/item
method: STL lower_bound (binary search)
total time: 0.3685713sec
insert: total 0.310394sec, avg 3.169617e-06sec/item
lookup: total 0.058177sec, avg 5.817700e-06sec/item
method: STL lower_bound (quick sort & binary search)
total time: 0.4019210sec
insert: total 0.395327sec, avg 4.036917e-06sec/item
lookup: total 0.006594sec, avg 6.593800e-07sec/item
method: st.c (chained hash)
total time: 0.2565951sec
insert: total 0.234092sec, avg 2.390450e-06sec/item
lookup: total 0.022503sec, avg 2.250310e-06sec/item
method: D language
total time: 0.4792000sec
insert: total 0.444400sec, avg 4.538028e-06sec/item
lookup: total 0.034800sec, avg 3.480000e-06sec/item
method: D language rehashed
total time: 0.7581000sec
insert: total 0.742500sec, avg 7.582101e-06sec/item
lookup: total 0.015600sec, avg 1.560000e-06sec/item


home / index

shinichiro.hamaji _at_ gmail.com / shinichiro.h