Subject: Re: Poor profile generation performance on spinning disks

From: Ludovic Courtès <[email-masked]>
Date: Tue, 29 Aug 2023 11:19:56 +0200

Hi Luis,

Luis Felipe <[email-masked]> skribis:

> I still use the same computer with the same hard drive, and performance has improved when installing packages. Running
>
>   $ time guix package -i perl --max-jobs=1
>
> initially took
>
>   (87 packages in profile)
>   real    8m3,043s
>   user    0m2,656s
>   sys    0m0,239s
>
> But now (guix 17fadbb), it takes
>
>   (96 packages in profile)
>   real	3m51,058s
>   user	0m7,490s
>   sys	0m0,788s

I think it’s not good.

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 thread contains an analysis of specific sources of slowness, such as
the cost of building the XDG MIME database:

  https://issues.guix.gnu.org/44053

I think we’re not done; we can probably do better by first figuring out
which parts take time (profiling) and then addressing specific issues.

Ludo’.