Skip to content

Commit 88de4aa

Browse files
committed
Increase chunk size to 64k in url_download
This greatly improves performance: - 1m40 to write a 3GB file with a chunksize of 128 bytes - 41s to write a 3GB file with a chunksize of 64 KB Signed-off-by: Vincent Michel <vincent.michel@vates.tech>
1 parent 4e15fde commit 88de4aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def url_download(url: str, filename: str) -> None:
335335
dir=destination.parent, prefix=f"{destination.name}.", suffix=".part", delete=False
336336
) as fd:
337337
temp_name = fd.name
338-
for chunk in r.iter_content(chunk_size=128):
338+
for chunk in r.iter_content(chunk_size=64 * 1024):
339339
fd.write(chunk)
340340
except BaseException:
341341
if temp_name is not None:

0 commit comments

Comments
 (0)