For my performance tests I often pipe output into
tail while you were redirecting to
/dev/null. I noticed that redirecting the
diff output took way longer than
tail.
When timing the
sort, however, sorting to file,
/dev/null, or
tail made no difference.
Anyway, I repeated the tests and I realized that my
diff output formatting makes a difference, too:
time: 0.07s piped into tail, 0.14s to /dev/null
Code:
diff --new-line-format=%L --old-line-format= --unchanged-line-format= allidssorted <(sort newids)
time: 0.14s piped into tail, 0.2s to /dev/null
Code:
diff allidssorted <(sort newids)
And now I feel like a total idiot:
time: 0.07s piped into tail, 1.7s to /dev/null
Code:
diff <formatting> <(sort allids) <(sort newids)
I should add that there is no output because there are no newids that are not in allids.