Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: resources
-
Team:External
-
Urgent?:No
Description
The method HttpResourcePath._as_local() is very slow to write the contents of the remote resource to the local temporary file.
The reason is that the method iter_content() uses by default a chunk size of 1 byte. As a consequence the contents of the remote file is copied one byte at a time.
Attachments
Issue Links
- is triggering
-
DM-33417 Backport DM-33360 to v23.0.x
- Done
The pull request to come corrects the issue and improves the situation by dynamically computing the chunk size to use as a function of the preferred block size of the temporary directory where the remote contents is downloaded to. The goal is to use a chunk size which is a reasonable compromise between using RAM for buffering the contents and the number of system calls issued to read the data from the socket and write them to the file.