Suggestion for speeding up pkg

From: Patrick McMunn <doctorwhoguy_at_gmail.com>
Date: Thu, 08 Jun 2023 01:50:40 UTC
I'm just a regular user of FreeBSD, but I'd like to make a suggestion. When
installing a large set of packages, such as "pkg install kde5", it can take
quite a while to download all that data. Why does pkg download ALL the
packages and only then begin to extract and install them? Would it not be a
more efficient use of time to calculate dependencies first, then begin
downloading the packages in the order in which they are required, and then
begin extracting and installing them as they are downloaded instead of
waiting for the download to complete before beginning installation?

I understand that part of the reason is verification and such, but the
default could be extracting and installing to a temporary directory then
merging to the live system once everything is downloaded and extracted.
Make the behavior configurable by the user. Set sane defaults. Check for
sufficient disk space immediately after dependency calculation to make sure
space is available for the downloads, the extracted contents, and any other
necessities. This will make for a more pleasant user experience.