-
Notifications
You must be signed in to change notification settings - Fork 8.4k
PSNativeCommandPreserveBytePipe's performance issues #26101
Copy link
Copy link
Open
Labels
KeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeWG-Engine-Performancecore PowerShell engine, interpreter, and runtime performancecore PowerShell engine, interpreter, and runtime performanceWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Metadata
Metadata
Assignees
Labels
KeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeWG-Engine-Performancecore PowerShell engine, interpreter, and runtime performancecore PowerShell engine, interpreter, and runtime performanceWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Type
Fields
Give feedbackNo fields configured for issues without a type.
Prerequisites
Steps to reproduce
Issue 1908 and pull request 17857 are about the feature
PSNativeCommandPreserveBytePipewhich introduces the ability to pipe binary data stream from one native application to another.This feature works, however, I encounter significantly lower speeds when using PowerShell to chain two native applications in comparison to the speed when using other shells like Bash on Linux or cmd.exe on Windows.
To reproduce the issue, take any file, and use
ddto read the file and pipe it toddagain to write it to the disk by using the commanddd if=inputfile bs=1MB | dd of=outputfile bs=1MB.Expected behavior
ddshould report the same speeds as if it was used in Bash or cmd.exeActual behavior
The speed is significantly reduced. The following tests are executed in an Ubuntu VM on an SSD drive.
Bash:
PowerShell 7:
In visuals, I have provided a screenshot of some tests I did in a freshly installed Debian 12 VM running in Hyper-V.
The drive was an NVMe SSD.
Error details
Environment data
Visuals