3 ms·
The grep version searches the input for "foobar" [1]. Hence, it doesn't solve the problem. [1] https://github.com/benhoyt/countwords/blob/eb2a8adf21c895907a7ab
by fmos 6y ago
The grep version searches the input for "foobar" [1]. Hence, it doesn't solve the problem.
[1] https://github.com/benhoyt/countwords/blob/eb2a8adf21c895907a7abd14a66650eb1f83c1a4/benchmark.py#L23 https://github.com/benhoyt/countwords/blob/eb2a8adf21c895907...
- rtb 6y agoThanks! I think he should make that a lot clearer in the "results" table.
- benhoyt 6y agoThanks for the feedback. I was trying to make that clear with "grep reference", but you're right, it's still ambiguous. I'll add a note to clear it up. Both "wc" and "grep" don't solve the problem, they're just comparisons to see how fast other programs can read the input (and in wc's case, tokenize into words). For grep, I'm using "grep foobar".