Re: Hash Function problem



websnarf@xxxxxxxxx wrote
(in article
<1141362894.760380.108090@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):

Similarly someone could mutate an embedded string scan into a modified
version of the hash function. Doing that with my function, or yours
would not murder the performance. I have examples of how to do block
based strlen here:

http://www.pobox.com/~qed/asmexample.html

(Look for strlen, there is both C and ASM code there) and the kind of
performance advantage of both your and my function over other
alternatives suggests to me that it would be kind of hard to lose badly
in performance even against some of these low quality functions.

Calling strlen first hurts only because you are using the compiler's
slow strlen, and you are ploughing through the memory multiple times
when you don't need to. (And all this work to solve a problem created
by the API you are stuck using.)

Question... are the "Update!" sections in forward or reverse
chronological order as they appear on the page? I'm guessing
that the Alan Mycroft derived 'xstrlen' is the fastest of the
bunch, but don't want to run a bunch of tests to reproduce what
you've done already. (Essentially, it would be nice if your
"Update!" sections were dated).


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





.