Optimize SFTP download performance with background prefetching and range parallelism - #36
Conversation
… and parallel ranges - Implement asynchronous background prefetching in `DCFSSFTPBufferedFile` using `asyncio.Queue` so SFTP read loops serve chunks directly from RAM without sequential RTT delays. - Lower `is_big_file` threshold in `dcfs/utils/others.py` to 2MB to trigger `download_file_parallel` Range requests for standard 8MB Discord file parts. - Increase default `download_max_concurrent_parts` from 3 to 6 in `dcfs/config.py` and `dcfs/core/client.py`. - Add unit tests for SFTP prefetching error propagation and lifecycle cleanup. Co-authored-by: VulcanoSoftware <113239901+VulcanoSoftware@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
… and parallel ranges - Implement asynchronous background prefetching in `DCFSSFTPBufferedFile` using `asyncio.Queue` so SFTP read loops serve chunks directly from RAM without sequential RTT delays. - Lower `is_big_file` threshold in `dcfs/utils/others.py` to 2MB to trigger `download_file_parallel` Range requests for standard 8MB Discord file parts. - Increase default `download_max_concurrent_parts` from 3 to 6 in `dcfs/config.py` and `dcfs/core/client.py`. - Add unit tests for SFTP prefetching error propagation and lifecycle cleanup. Co-authored-by: VulcanoSoftware <113239901+VulcanoSoftware@users.noreply.github.com>
This change significantly improves SFTP download speeds:
DCFSSFTPBufferedFilevia a background worker pushing stream chunks into a boundedasyncio.Queue. Subsequent SFTPread()calls are served directly from RAM without waiting on sequential network round-trips.is_big_filethreshold to 2MB so standard 8MB Discord parts trigger parallel HTTP Range downloads from Discord CDN.download_max_concurrent_partsto 6 for higher part concurrency during multi-part file downloads.tests/test_sftp_handler.pyand updated config/utility tests.PR created automatically by Jules for task 10218746665379169542 started by @VulcanoSoftware