-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some optimizations for uploading to minio #15255
Conversation
I can confirm that this PR fixes #15253 |
e2c75e0
to
a688671
Compare
I see a number of architectural issues with this approach. I can understand why an argument polymorphism approach has been chosen instead of an explicit argument approach here and whilst I'm genuinely not sure it's the right thing - I think it's probably OK. But I absolutely do not think that the The Thus it's documented in one place and self contained. See https://github.com/golang/go/wiki/CodeReviewComments#interfaces In terms of the But further everything that is using a |
Actually this argument polymorphism is really going to be confusing: Consider what happens if you pass a bufio.Reader into Save... to a cursory glance it looks like it implements ReadSizer but it doesn't - thankfully as its Size function means a very different thing. We really should be implementing and using the io/fs interfaces but in the meantime just add a size argument to Save |
This PR proposes an alternative solution to go-gitea#15255 - just add the size to the save function. Yes it is less apparently clean but it may be more correct. Close go-gitea#15255 Fix go-gitea#15253 Signed-off-by: Andrew Thornton <[email protected]>
Please send a PR to replace this one. |
This PR proposes an alternative solution to go-gitea#15255 - just add the size to the save function. Yes it is less apparently clean but it may be more correct. Close go-gitea#15255 Fix go-gitea#15253 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#15264 This PR proposes an alternative solution to go-gitea#15255 - just add the size to the save function. Yes it is less apparently clean but it may be more correct. Close go-gitea#15255 Fix go-gitea#15253 Signed-off-by: Andrew Thornton <[email protected]>
This PR proposes an alternative solution to #15255 - just add the size to the save function. Yes it is less apparently clean but it may be more correct. Close #15255 Fix #15253 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
A fixed size to minio upload sdk may spend less memory than give it a
-1
. So let's give the size when possible.close #15253