I am writing a custom apache log parser for my company and I noticed a performance issue that I can’t explain. I have a text file log.txt with size 1.2GB.
The command: sort log.txt is up to 3 sec slower than the command: cat log.txt | sort
Does anybody know why this is happening?
cat file | sortis a Useless Use of Cat.It shouldn’t take longer. Are you sure your timings are right?
Please post the output of:
and
You need to run the commands a few times and get the average.