Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm glad that someone benchmarked this. However, you were a little bit unfair to the chop method. :-) The scalar reverse and array assignments aren't necessary. The following is 5 times faster (although still 5 times slower than the xor method):
Update: Albannach points out that because the strings in this test are not of equal length, the reverse is required. My code was based on the original sample data. Also, it is worth adding that the speed of the xor method is less dependent on the string length than the other methods.
--
In reply to Re: Some of the above suggestions, benchmarked (Re: Similarity of strings)
by jmcnamara
|
|