some loop { for my $regexp ( regexps ) { /$regexp/ } }
is a very bad pattern unless the regexps are precompiled. In your case, the regexps are not precompiled since you're using a hash key (a string) as the regexp.
In the first program, you could even flatten all of %ignore into a single regexp if you didn't need to do $ignore{$regexp}++.
The performance of the regexp engine depends highly on the regexp in question, but you didn't show us the regexps.
Since you only case about one value returned by split, a regexp should be faster than split.
In reply to Re: regexp performance on large logfiles
by ikegami
in thread regexp performance on large logfiles
by snl_JYDawg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |