-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Slow writes for large response body for HTTPS connection #133
Comments
Hey @nav-agarwal, Thanks for reporting this! I assume you've made a typo in requests code (you wrote P.S. Your explanation makes a lot of sense. Would you be interested in submitting that as a PR? |
@nav-agarwal try out #134 Also, have you tried Python 3 version? It should be better optimized. |
|
@nav-agarwal are you happy with the latest fix? #137 |
@webknjaz : Fix is working fine. Thanks for the quick fix |
I'm submitting a ...
Describe the bug. What is the current behavior?
Performance Bug
Slow writes observed(<2MB/permin) in case of large response body(around 300MB) when using HTTPS connection
What is the motivation / use case for changing the behavior?
Poor download performance for HTTPS connection on local server
To Reproduce
Steps to reproduce the behavior:
Expected behavior
On HTTP connection same requests finishes within seconds
Details
Root Cause:Bug is due to following code in write function of makefile. This function is used for HTTPS connection writes only:
data = data[bytes_sent:]
Here we are copying almost complete buffer after every socket write. In python. slices leads to copy of remaining buffere as strings are immutable.
Possible fix:
Do chunking in small buffers by matining idx till which write has happened
Environment
Additional context
Performance Bug
The text was updated successfully, but these errors were encountered: