in reply to large file and processing efficiency

See Slow Regex - How to Optimize, noting in particular GrandFather's benchmark results of ikegami's solution.

The summary is: it's better to grab the first word and look it up in a hash than to use a big ol' alternation. If you can't parse out the word, though, you might want to look at Regexp::Optimizer or some such.


Caution: Contents may have been coded under pressure.
  • Comment on Re: large file and processing efficiency