-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Add download_chunk_size property to HTTPRequest. #33862
Add download_chunk_size property to HTTPRequest. #33862
Conversation
This allows setting the `read_chunk_size` of the internal HTTPClient. This is important to reduce the allocation overhead and number of file writes when downloading large files, allowing for better download speed.
Note I think we should raise the default value to something higher, 32-64KiB, to better cover the download file use case by default. In any case, we should do that for editor-related HTTPRequest where download speed is quite important. |
Sounds good to me. Are there any drawbacks to using a value like 64 KiB by default? |
Well, there might be some memory overhead, especially when reading in non-blocking mode from slow servers (or servers that sends little data at a time). But in many other case (like the referenced issue) it would mean a much lower number of allocations. In general, |
Thanks! |
I think a default of 64 KiB would make sense. Or 32 KiB if you think 64 KiB is too high as all-rounder value (knowing that most users will use the default). Can you make a follow-up PR? |
Now it works like a charm, Thanks Faless. |
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862.
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862. (cherry picked from commit 1335709)
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862.
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862. (cherry picked from commit 1335709)
This allows setting the
read_chunk_size
of the internal HTTPClient.This is important to reduce the allocation overhead and number of file
writes when downloading large files, allowing for better download speed.
Fixes #32807 (the user will need to raise the
download_chunk_size
to a higher value. 64KiB is enough).In general, and like in other cases in Godot networking, we are doing some extra buffering, which could be cleaned up in the future.