Quote:
Originally Posted by
Scrutinizer
Another factor that might prove an important factor is which awk or which grep is used.
Absolutely. GNU tools in particular tend to be slower than their counterparts.
Quote:
Originally Posted by
Scrutinizer
@alister, results of tests 1,3 and the bash loop may be flawed because the regex or pattern match do not match the lines of the OP's input spec..
Woops. My test data was delimited by a single space, so the output of the commands would be correct, but the time was slightly underestimated due to the simpler regular expression.
Using ed, I replaced the single space in each line with a <space><tab><space> sequence. I re-ran the tests, replacing the <space> in the regular expression with
[<space><tab>]+, and the time for each test increased by 1 to 3 seconds with the rankings unchanged.
Interesting observation: character classes really slowed down GNU grep.
egrep '^83[[:blank:]]+... takes twice as long as
egrep '^83[ <tab>]+..., 30s versus 15s. With perl, the difference was approximately 0.6s.
As for the bash trinket, I won't bother fixing that. I'm not _that_ bored.
Thanks for living up to your nick.
Regards,
Alister