3 ms·
I think it was this one: https://news.ycombinator.com/item?id=23923645 https://news.ycombinator.com/item?id=23923645 Also I think there is a difference between
by xg15 5y ago
I think it was this one: https://news.ycombinator.com/item?id=23923645 https://news.ycombinator.com/item?id=23923645
Also I think there is a difference between grep on files, i.e. "grep ... file1 file2" or "grep ... -R somedir" and grep on stdin, i.e. "something | grep ...".
My understanding was that in the first case, grep can make use of random access APIs to control the size of the input chunks it processes or skip over parts that are known in advance not to match. That's not possible if the input is fed through stdin.
I haven't seen any actual comparisons though apart from "subjective" speed. So things might be wrong.