Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear monks,
I'm looking for suggestions to optimize the following task: Given two words, find how many characters they share. For instance, "help" and "temp" share 2 characters, "monk" and "perl" share 0, etc...
First, I implemented the following simple version:
Then, I tried optimizing it. The following is a regexp version: Benchmarking proved that the second version is about 50% slower than the first & simple one. Any ideas on how this can be made faster ? TIA, Spurperl In reply to Optimizing a string processing sub by spurperl
|
|