Extremely high CPU usage when piping data #18702
Labels
Issue-Question
ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
Resolution-Answered
The question is answered.
Resolution-Duplicate
The issue is a duplicate.
Prerequisites
Steps to reproduce
Linux, Powershell Core 7.2.3
When I try to pass large mounts of data (an image), for example:
$ curl -L https://download.opensuse.org/distribution/leap/15.4/appliances/iso/openSUSE-Leap-15.4-CR-DVD-x86_64-Media.iso | dd of=/dev/null
(with fast internet, alternatively one may try piping
xzcat
's output todd
).Expected behavior
For the similar command bash doesn't use any CPU at all.
Actual behavior
CPU usage of `pwsh` process us 150-160% (4 cores).
Error details
I understand that pwsh may read input and split into lines while bash simply does `dup2`, but maybe there could be some short-circuit if both ends of pipe operator are fed to an external process.
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: