From ed19b4076e0ec9252202086e65ffcc42510b6cdd Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sun, 24 Nov 2019 13:20:24 +0100 Subject: Add download_chunk_size property to HTTPRequest. 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. --- doc/classes/HTTPClient.xml | 12 +++--------- doc/classes/HTTPRequest.xml | 4 ++++ 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 52e4b94051..3347eeafa7 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -170,15 +170,6 @@ Sends the body data raw, as a byte array and does not encode it in any way. - - - - - - - Sets the size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk]. - - @@ -187,6 +178,9 @@ The connection to use for this client. + + The size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk]. + diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index d0e8a5972f..98ba08e6a2 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -93,6 +93,10 @@ Maximum allowed size for response bodies. + + The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size]. + Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory. + The file to download into. Will output any received file into it. -- cgit v1.2.3