Subject: bug#65720: Guile-Git-managed checkouts grow way too much

From: Ludovic Courtès <[email-masked]>
Date: Wed, 13 Sep 2023 20:10:38 +0200

Hi,

wolf <[email-masked]> skribis:

> (define (time proc)
>   (let* ((start (get-internal-run-time))
>          (_ (proc))
>          (end   (get-internal-run-time)))
>     (exact->inexact (* 1000 (/ (- end start) internal-time-units-per-second)))))
>
> (format #t "Guix: ~ams\nGit:  ~ams\n"
>         (time (λ () (commit-relation c1 c2)))
>         (time (λ () (shelling-commit-relation c1 c2))))

‘get-internal-run-time’ returns “units of processor time” used by the
current process (info "(guile) Time").  When shelling out, the process
calls waitpid(2) and does nothing, so naturally its processor time is
close to zero.

‘get-internal-real-time’ should give something closer to elapsed time.

Ludo’.