Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: Hamming Distance Between 2 Strings - Fast(est) Way? (Ah! But!)

by BrowserUk (Pope)
on Oct 14, 2005 at 21:04 UTC ( #500369=note: print w/replies, xml ) Need Help??


in reply to Re^4: Hamming Distance Between 2 Strings - Fast(est) Way?
in thread Hamming Distance Between 2 Strings - Fast(est) Way?

Of course you are right, nothing is deleted without /d.

However, the "count the stars" mode does seem to be consistantly around 10% quicker?

$s = "\0\1" x 10000;; cmpthese -1, { A=> q[ $n1 = $s =~ tr[\0][\0] ], B=> q[ $n2 = $s =~ tr[\0][]c ] }; Rate B A B 23522/s -- -9% A 25935/s 10% -- print "$n1 : $n2";; 10000 : 10000

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
  • Comment on Re^5: Hamming Distance Between 2 Strings - Fast(est) Way? (Ah! But!)
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://500369]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2020-12-04 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (58 votes). Check out past polls.

    Notices?