Skip to content

Feature request: Parallel downloads #21992

@jdfm

Description

@jdfm

Description of feature/enhancement

Currently brew-cask downloads packages one at a time, why not allow the downloads to run in parallel? Unless packages have dependencies on other packages, they could even be installed after they finish downloading while other downloads are still running as well.

Justification

Some packages are very small, others are very large, the small packages, depending on the order they are specified, will be held up by the larger packages. Packages do not have central repositories, calibre, blender, and mactex, are all downloaded from different servers, so their download speeds will also vary between them, some slower, some faster. Being able to download the packages in parallel should save a lot of time in the end.

Example use case

brew cask install mactex calibre blender

mactex is a very large package, like 5GB. Under the current version of brew-cask we have to wait until mactex finishes not only downloading but also installing for it to finally allow for the other packages to download, install, download and install. Here's what it looks like:

mactex starts downloading
mactex finishes downloading
mactex starts installing
mactex finishes installing
calibre starts downloading
calibre finishes downloading
calibre starts installing
calibre finishes installing
blender starts downloading
blender finishes downloading
blender starts installing
blender finishes installing

total_time = sum(download_times) + sum(install_times)

If we had parallel downloads:

brew cask install --parallel-download=2 mactex calibre blender

mactex starts downloading
calibre starts downloading
calibre finishes downloading
blender starts downloading
calibre starts installing
blender finishes downloading
calibre finishes installing
blender starts installing
mactex finishes downloading
blender finishes installing
maxtex starts installing
mactex finishes installing

total_time < sum(download_times) + sum(install_times)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions