In article <la4ojq$tq7$
3...@news.m-online.net>,
This is true.
The locale in use can also make a big difference, as well as the
awk version.
And there is a new grep version just releaed, 2.16, which is likely to
be faster than 2.10.
The default awk on Ubuntu is mawk, which only works in 8 bit characters
and ignores locales. It would not surprise me if it were very fast.
Setting LC_ALL=C in the environment will speed up both grep and gawk.
Also, you should throw away the first run's timings since the system
has to read the file from disk. The 2nd run will be faster since the
file's contents are in the buffer cache.
Timing things isn't as simple as it might look.
And in any case, you're comparing apples to oranges; the programs do
different things, and it's OK if awk is slower at the straight I/O and
pattern matching.
--
Aharon (Arnold) Robbins arnold AT skeeve DOT com
P.O. Box 354 Home Phone:
+972 8 979-0381
Nof Ayalon
D.N. Shimshon 9978500 ISRAEL