3 ms·
Are there performance drawbacks in particular with long pipelines (e.g. something like `cat | grep | sed | bc | paste | ...`)?
by vander_elst 2y ago
Are there performance drawbacks in particular with long pipelines (e.g. something like `cat | grep | sed | bc | paste | ...`)?
- ComputerGuru 2y agoTo the contrary. They’re all run in parallel and the (standard) output goes directly from one to the next without being buffered by the shell. Unix overhead for process creation is very low compared to others, doing the same under, for example, Windows, would be more expensive. But if you have to run n processes, much better to run them in a single pipeline like that. (Source: I’m a shell developer. Fish-shell ftw!)