Title: PSNativeCommandPreserveBytePipe's performance issues · Issue #26101 · PowerShell/PowerShell · GitHub
Open Graph Title: PSNativeCommandPreserveBytePipe's performance issues · Issue #26101 · PowerShell/PowerShell
X Title: PSNativeCommandPreserveBytePipe's performance issues · Issue #26101 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/26101
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PSNativeCommandPreserveBytePipe's performance issues","articleBody":"### Prerequisites\n\n- [x] Write a descriptive title.\n- [x] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [x] Search the existing issues.\n- [x] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [x] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\n[Issue 1908](https://github.com/PowerShell/PowerShell/issues/1908) and [pull request 17857](https://github.com/PowerShell/PowerShell/pull/17857) are about the feature `PSNativeCommandPreserveBytePipe` which introduces the ability to pipe binary data stream from one native application to another.\n\nThis 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.\n\nTo reproduce the issue, take any file, and use `dd` to read the file and pipe it to `dd` again to write it to the disk by using the command\n`dd if=inputfile bs=1MB | dd of=outputfile bs=1MB`.\n\n### Expected behavior\n\n`dd` should report the same speeds as if it was used in Bash or cmd.exe\n\n### Actual behavior\n\nThe speed is significantly reduced. The following tests are executed in an Ubuntu VM on an SSD drive.\n\nBash:\n\n```\nuser@ubuntu:/tmp$ dd if=dotnet-sdk-9.0.305-win-x64.exe bs=1MB | dd of=dotnetout bs=1MB\n226+1 records in\n226+1 records out\n226741024 bytes (227 MB, 216 MiB) copied, 0.988518 s, 229 MB/s\n0+3588 records in\n0+3588 records out\n226741024 bytes (227 MB, 216 MiB) copied, 0.98907 s, 229 MB/s\n```\nPowerShell 7:\n```\nuser@ubuntu:/tmp$ pwsh\nPowerShell 7.5.3\nPS /tmp\u003e dd if=dotnet-sdk-9.0.305-win-x64.exe bs=1MB | dd of=dotnetout bs=1MB\n226+1 records in\n226+1 records out\n226741024 bytes (227 MB, 216 MiB) copied, 1.68791 s, 134 MB/s\n0+106333 records in\n0+106333 records out\n226741024 bytes (227 MB, 216 MiB) copied, 1.93509 s, 117 MB/s\nPS /tmp\u003e\n```\n\nIn visuals, I have provided a screenshot of some tests I did in a freshly installed Debian 12 VM running in Hyper-V.\nThe drive was an NVMe SSD.\n\n### Error details\n\n```\nN/A\n```\n\n### Environment data\n\n```powershell\nPS \u003e $PSVersionTable\n\nName Value\n---- -----\nPSVersion 7.5.3\nPSEdition Core\nGitCommitId 7.5.3\nOS Ubuntu 24.04.3 LTS\nPlatform Unix\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nPSRemotingProtocolVersion 2.3\nSerializationVersion 1.1.0.1\nWSManStackVersion 3.0\n\nPS \u003e\n```\n\n### Visuals\n\n\u003cimg width=\"1411\" height=\"823\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f6e030c3-e881-42fa-8be1-35a684cc072a\" /\u003e","author":{"url":"https://github.com/dt-flo","@type":"Person","name":"dt-flo"},"datePublished":"2025-09-27T07:13:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/26101/PowerShell/issues/26101"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e6487cd7-60a3-f8ec-4578-daf71fd9d7ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5A4:6DA0E:5D05F8:8150B2:6A552215 |
| html-safe-nonce | 37117b3c6efbc73224d0f69debee1d31f602a596a878f08e019e7340ec570121 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUE0OjZEQTBFOjVEMDVGODo4MTUwQjI6NkE1NTIyMTUiLCJ2aXNpdG9yX2lkIjoiODIyMjExMTAzMDQ1OTA0ODQ2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c053cd09b256520b2f21db65655f2f1a9c129b89bd92f2f83d67c7e05f1db073 |
| hovercard-subject-tag | issue:3459901763 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/26101/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2df3b7d46d55d18c4cb95f1e26932415d3298438383ca948bde54c597060fb96/PowerShell/PowerShell/issues/26101 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2df3b7d46d55d18c4cb95f1e26932415d3298438383ca948bde54c597060fb96/PowerShell/PowerShell/issues/26101 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dt-flo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 358dd24ad7465d20e3fae729b5b169d35b0dd7f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width