|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-10 09:10:16
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:019c01c5256a$561efe40$6601a8c0_at_pdimov...
| Peter Dimov wrote:
| > But as I said, benchmarking hash functions is pointless. Real programs
| > do not compute the hash value of a random 256 byte buffer five million
| > times.
|
| ... or if they do, they use different 256 byte buffers and do not operate
| from the L1 cache. ;-)
no, but AFAICT we cannot exclude that a certain hash-function is much faster
*and*
otherwise behaves as good as the other "naive" ones.
Can anybody answer this question: is it always optimal to use the whole
range to compute the hash value; for eg. strings, if I know the average length
of my strings, I can't see that it would make sense to process much more
the the average length (or perhaps even shorter).
maybe hash_range should be specified as
temaplate
< unsigned max, // max length of range to consider
class Iter
>
hash_range( Iter, Iter );
?
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk