HTTP responses slow due to bytes -> string conversion
Hi Frede, @linux-aarhus
In the new implementation for http downloads, there is a line:
This is problematic because that will convert that ~160 KB gz that is being downloaded into a string which costs a lot of time.
The line can actually be removed completely (you probably wanted to make sure that you really download the file content with this, but it does not seem to be required)
thanks,
MO
probe_start = time.time()
resp = requests.get(url="https://manjaro.moson.eu/unstable/core/x86_64/core.db.tar.gz")
resp.raise_for_status()
print("ms after HTTP call: ", round(time.time() - probe_start, 3))
_ = resp.text
print("ms after bytes to string conversion: ", round(time.time() - probe_start, 3))
ms after HTTP call: 0.085
ms after bytes to string conversion: 0.881
Edited by moson