Re:Benchmarking shell pipelines and the Unix “tools” philosophy
by justinsaccount on Tuesday January 07, 2020 @04:32PM
(#21985136)
Thanks for explaining my own comment to me.
Re:Benchmarking shell pipelines and the Unix “tools” philosophy
by tuldia on Tuesday January 07, 2020 @07:03PM
(#21986691)
Not explaining, trying to tell that you are comparing apples to oranges and making a conclusion based on that.
Also, you don't need to spawn a subshell nor feed sort via stdin in the first example :)
Re:Benchmarking shell pipelines and the Unix “tools” philosophy
by cperciva on Tuesday January 07, 2020 @11:58PM
(#21988500)
He's comparing apples to oranges and reaching the conclusion that... yes, apples and oranges are different things. He's quite aware of this, and even points out the tradeoff -- `sort | uniq -c` still works if your dataset doesn't fit into RAM.
Re:Benchmarking shell pipelines and the Unix “tools” philosophy
by tuldia on Wednesday January 08, 2020 @02:30AM
(#21989132)
Counting "words" vs sorting+counting "lines" are a complete different thing.
Heck, forget about RAM, the output of both programs don't even match.
That awk is pretty efficient and fast is no surprise ;)
While in the awk example it is creating a hash table with all words and incrementing by the key and then printing.
There is no sorting plus printing may be buffered.