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





.



Relevant Pages

  • Re: Hash Function problem
    ... version of the hash function. ... would not murder the performance. ... chronological order as they appear on the page? ... bunch, but don't want to run a bunch of tests to reproduce what ...
    (comp.programming)
  • Re: Haditha - A Town Awoke to Slaughter
    ... - civilians have died. ... That pisses me off a lot more than a bunch of young Marines, ... accessories to murder. ... demanding that Bush and Cheney be impeached, ...
    (alt.true-crime)
  • Re: (OT) Man shot by armed police on Tube
    ... He was NOT wearing "heavy clothes". ... most people would flee from a bunch of men in plain clothes. ... be used to clarify the MURDER of an innocent man. ... >> police. ...
    (rec.sport.soccer)