in reply to Knuth-Morris-Pratt Vs. Perl
Such a comparison is most likely useless, because the Perl string matching is written in C (and likely uses a Boyer-Moore search for longer strings), and your Perl implementation will either use (Perl) arrays of characters, which will be really slow or use Perls string search functions itself and thus likely be hampered by them.
But as the sourcecode for Perl is easily downloadable, feel free to take a look at pp.c, the function fbm_instr.
Usually, we only help people with their homework when they admit it's homework.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Knuth-Morris-Pratt Vs. Perl
by jdporter (Paladin) on Nov 12, 2007 at 00:33 UTC |