in reply to Re^3: Need Speed:Search Tab-delimited File for pairs of names
in thread Need Speed:Search Tab-delimited File for pairs of names

I second the notion that regular expressions are a better choice, especially using precompiled patterns.

I vaguely recall that a RE serach without metacharacters should be fast. There is a short statement implying this in my camel book in the Efficiency section.

You can always do some performance benchmarking to verify.

  • Comment on Re^4: Need Speed:Search Tab-delimited File for pairs of names

Replies are listed 'Best First'.
Re^5: Need Speed:Search Tab-delimited File for pairs of names
by Laurent_R (Canon) on Dec 17, 2013 at 10:02 UTC
    Yes, indeed, a RE search without meta-characters is fast. But index is still faster:
    $ perl index_regex_bench.pl Rate Regex Index Regex 5010020/s -- -23% Index 6544503/s 31% --