Subject: Re: Poor profile generation performance on spinning disks

From: Ludovic Courtès <[email-masked]>
Date: Sat, 09 Sep 2023 13:02:11 +0200

Hi Luis,

Luis Felipe <[email-masked]> skribis:

>> Could you time just profile generation itself?
>> 
>
>> To do that, you need to find the profile generation and then to rebuild
>> it, along these lines:
>> 
>
>> DRV=$(guix gc --derivers $(readlink -f ~/.guix-profile))
>> time guix build --check $DRV
>
> The above results in
>
>   real	1m28,841s
>   user	0m2,169s
>   sys	0m0,450s

Thanks.

It means that profile generation itself (and not just hooks) is slow.

The place to look at is (guix build union).  Unfortunately, I suspect
there’s little room for optimization at this stage (see commit
12129998689648923b58c426362a1bc875da75f9 from… 2014).

Fundamentally, ‘union-build’ traverses every input directory, which is
expensive with low-end hard disks.  It would still be worth
investigating (for example by strace’ing the ‘union-build’ process) in
case we missed optimizationm opportunities, though.

Thanks,
Ludo’.