Hacker News new | ask | show | jobs
by alexfoo 5036 days ago
Indeed, I don't see why people get so upset (or pedantic) about what are, effectively, NOPs in command-lines.

However, things change if you start adding certain options to sort:-

  sort -m order.*
and

  cat order.* | sort -m
are definitely not the same thing (for most input files at least).
1 comments

Perhaps because sending GiBs through read(2) and write(2) unnecessarily isn't a NOP?
You can do that sending while you're waiting for the disk to provide said GiBs. I also believe that useless uses of cat are often acceptable for readability (many novices are not familiar with redirecting standard input, particularly not as the first thing on a command line).
Who said the GiBs need to be fetched from disk; they could already be in RAM. Even if not, it's still adding many system calls and context switches when the CPU could be doing other things; the machine isn't running just this one thing.
Who said NOPs are free? NOPs still take at least one clock cycle.
It's not that simple anymore... In modern CPUs, NOPs are discarded by the decoding units so they never occupy the exeuction units. If decoding BW is not saturated (and most often, it's not), NOPs are indeed "free".