x/crypto/ssh: performance improvement #39117
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm using crypto/ssh for SFTP inside SFTPGo (https://github.com/drakkan/sftpgo). The performance are generally good and very similar to OpenSSH for SFTP downloads. SFTP uploads are a bit slower than OpenSSH.
Here is a profiling result:
so we can improve upload performance avoid this allocation
What did you expect to see?
Data upload with minimal memory allocation to improve performance
What did you see instead?
a new slice is allocated for each received packet
I can try to write a patch but I would like some suggestions on the best approach to do this.
I'm thinking about a per connection circular ring buffer of slices with a configurable max size, so we can reuse the preallocated slices once the ring buffer is filled.
What do you think about? Do you have other suggestions? Thanks!
The text was updated successfully, but these errors were encountered: