-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
receiveFile memory optimization: do not use bytes.buffer but write di… #9415
Conversation
…rectly to file Signed-off-by: ls0f <lovedboy.tk@qq.com>
Codecov Report
@@ Coverage Diff @@
## master #9415 +/- ##
=======================================
Coverage 45.77% 45.78%
=======================================
Files 220 220
Lines 26168 26165 -3
=======================================
Hits 11979 11979
+ Misses 12531 12529 -2
+ Partials 1658 1657 -1
Continue to review full report at Codecov.
|
Thanks for the optimization! I suggested this when @leoluz wrote the stream code. This was his response:
@leoluz what are your thoughts now? Should we try to choose memory vs. disk based on file size? |
@crenshaw-dev if that is becoming a real issue I think we should go in the direction suggested while back:
@ls0f are you facing memory issues with large files? Can you pls provide more context in the PR description? |
No, Actually I was reading the source code of argo-cd recently because we have a project that will use it. So it's not really a problem for me now. In addition, i think write file in append mode won't really reduce the efficiency too much Anyway. if it'is unnessessary, the pr can be closed. If someone does facing this issue, consider fixing it. |
@ls0f Looking at your implementation one more time, I agree with that. Spoke with @crenshaw-dev and we both agree that defaulting to file-system in append mode is preferable in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…rectly to file (#9415) Signed-off-by: ls0f <lovedboy.tk@qq.com>
Cherry-picked to 2.4. |
receiveFile memory optimization: do not use bytes.buffer but write directly to file
Signed-off-by: ls0f lovedboy.tk@qq.com
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: