You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
My use case : I sent a huge stdin to a powershell in order to transfer a file. I send a base64 stream which is decoded on the fly at destination and outputed to a file.
In RunWithContextWithInput(...), io.Copy(cmd.String, stdin) is just fine as long as everything is inlined properly by the compiler.
But in my case, I want to have some information during the copy, so I use a struct of my own to have some feedback:
Using this, I get a 3 to 4 performance factor decrease, which is huge. All because the Read function cannot be inlined anymore.
io.Copy(...) used 32K buffers. By replacing the io.Copy(...) by io.CopyBuffer(...) with larger buffer size than 32K, the performance is the same than when not using my ProgressReader.
So my suggestion is to add an optional bufferSize parameter to the RunWithContextInput function, and use io.CopyBuffer is the parameter is provided.
The text was updated successfully, but these errors were encountered:
Hi,
My use case : I sent a huge stdin to a powershell in order to transfer a file. I send a base64 stream which is decoded on the fly at destination and outputed to a file.
In RunWithContextWithInput(...), io.Copy(cmd.String, stdin) is just fine as long as everything is inlined properly by the compiler.
But in my case, I want to have some information during the copy, so I use a struct of my own to have some feedback:
Using this, I get a 3 to 4 performance factor decrease, which is huge. All because the Read function cannot be inlined anymore.
io.Copy(...) used 32K buffers. By replacing the io.Copy(...) by io.CopyBuffer(...) with larger buffer size than 32K, the performance is the same than when not using my ProgressReader.
So my suggestion is to add an optional bufferSize parameter to the RunWithContextInput function, and use io.CopyBuffer is the parameter is provided.
The text was updated successfully, but these errors were encountered: