3 ms·
I get what you're saying for the "already in a REPL" thing, but as far as fork/exec overhead, xargs does a single fork/exec for every thousand or so files you s
by aidenn0 14y ago
I get what you're saying for the "already in a REPL" thing, but as far as fork/exec overhead, xargs does a single fork/exec for every thousand or so files you search; the overhead is tiny compared to everything else.
- dvdkhlng 14y agoNot even that, but xargs can also be made to run N processes in parallel ('xargs -P N'), making a find|xargs sed pipe perform much better than anything you could easily invent on your own. Note that 'xargs -P' behaves very similar to 'make -j' and is often useful as a simple work-unit scheduler.