Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@nigger @Suiseiseki @bonkers No, I knew you had a rainbow-colored prompt before you posted a screenshit of your macbook, sir. I don't know why you'd `sudo grep` your own home directory, but that's not my business.
You have failed to understand the point. There are four main operations: (1) walk the directory tree, (2) read the files, (3) apply regular expression filtering, (4) print the results. You think all four need to be handled in the same program instead of a composable pipeline. This is what I was getting at when I said "instrument grep to invoke it more than once". `grep -r` is degeneracy: you've already got the dog's cock in your mouth, you are telling me how to suck it faster. I don't plan to suck the dog's cock to being with and I advise you to stop doing so.
These are all very different operations:
time sh -x -c "find -type f -print0 | xargs -0 -P $(nproc) -n 128 grep 'go piss up a rope, you dogfucker'"
time sh -x -c "find -type f -print0 | xargs -0 -P $(nproc) -n 1 grep 'go piss up a rope, you dogfucker'"
time sh -x -c "grep -r 'go piss up a rope, you dogfucker' . "
time sh -x -c "find -type f -print0 | xargs -0 -P $(nproc) -n 128 cat | grep 'go piss up a rope, you dogfucker'"
time sh -x -c "find -type f -print0 | xargs -0 -P $(nproc) -n 1 cat | grep 'go piss up a rope, you dogfucker'"