guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: gnu: Improve memoization of 'package-with-bootstrap-guile'.


From: guix-commits
Subject: 01/04: gnu: Improve memoization of 'package-with-bootstrap-guile'.
Date: Sat, 12 Oct 2019 09:18:39 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 099dbc4fd332d27a5010f17093f1d6b09d26212e
Author: Ludovic Courtès <address@hidden>
Date:   Sat Oct 12 14:42:36 2019 +0200

    gnu: Improve memoization of 'package-with-bootstrap-guile'.
    
    Before that, the command:
    
      GUIX_PROFILING=memoization guix build -e '(@@ (gnu packages commencement) 
gnu-make-final)' -nd
    
    would show that 'package-with-bootstrap-guile' was called 2256
    times (hit rate: 89%).  Now, it is called 745 times (hit rate: 85%).
    
    "guix build libreoffice -nd" goes from 2.60s to 2.40s (-8%).
    
    * gnu/packages/commencement.scm (gnu-make-final)
    (coreutils-final, grep-final, sed-final, %final-inputs): Call
    'package-with-bootstrap-guile' before 'package-with-explicit-inputs'.
---
 gnu/packages/commencement.scm | 55 +++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 5bd139f..f234fa0 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2403,34 +2403,33 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker 
-Wl,~a/~a \"$@\"~%"
 
 (define gnu-make-final
   ;; The final GNU Make, which uses the final Guile.
-  (package-with-bootstrap-guile
-   (package-with-explicit-inputs gnu-make
-                                 (lambda _
-                                   `(("guile" ,guile-final)
-                                     ,@(%boot5-inputs)))
-                                 (current-source-location))))
+  (package-with-explicit-inputs (package-with-bootstrap-guile gnu-make)
+                                (lambda _
+                                  `(("guile" ,guile-final)
+                                    ,@(%boot5-inputs)))
+                                (current-source-location)))
 
 (define coreutils-final
   ;; The final Coreutils.  Treat them specially because some packages, such as
   ;; Findutils, keep a reference to the Coreutils they were built with.
-  (package-with-bootstrap-guile
-   (package-with-explicit-inputs coreutils
-                                 %boot5-inputs
-                                 (current-source-location)
+  (package-with-explicit-inputs (package-with-bootstrap-guile coreutils)
+                                %boot5-inputs
+                                (current-source-location)
 
-                                 ;; Use the final Guile, linked against the
-                                 ;; final libc with working iconv, so that
-                                 ;; 'substitute*' works well when touching
-                                 ;; test files in Gettext.
-                                 #:guile guile-final)))
+                                ;; Use the final Guile, linked against the
+                                ;; final libc with working iconv, so that
+                                ;; 'substitute*' works well when touching
+                                ;; test files in Gettext.
+                                #:guile guile-final))
 
 (define grep-final
   ;; The final grep.  Gzip holds a reference to it (via zgrep), so it must be
   ;; built before gzip.
-  (let ((grep (package-with-bootstrap-guile
-               (package-with-explicit-inputs grep %boot5-inputs
-                                             (current-source-location)
-                                             #:guile guile-final))))
+  (let ((grep (package-with-explicit-inputs
+               (package-with-bootstrap-guile grep)
+               %boot5-inputs
+               (current-source-location)
+               #:guile guile-final)))
     (package/inherit grep
                      (inputs (alist-delete "pcre" (package-inputs grep)))
                      (native-inputs `(("perl" ,perl-boot0))))))
@@ -2443,10 +2442,10 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker 
-Wl,~a/~a \"$@\"~%"
 
 (define sed-final
   ;; The final sed.
-  (let ((sed (package-with-bootstrap-guile
-              (package-with-explicit-inputs sed %boot6-inputs
-                                            (current-source-location)
-                                            #:guile guile-final))))
+  (let ((sed (package-with-explicit-inputs (package-with-bootstrap-guile sed)
+                                           %boot6-inputs
+                                           (current-source-location)
+                                           #:guile guile-final)))
     (package/inherit sed (native-inputs `(("perl" ,perl-boot0))))))
 
 (define-public %final-inputs
@@ -2454,12 +2453,12 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker 
-Wl,~a/~a \"$@\"~%"
   ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are
   ;; used for origins that have patches, thereby avoiding circular
   ;; dependencies.
-  (let ((finalize (compose package-with-bootstrap-guile
-                           (cut package-with-explicit-inputs <> %boot6-inputs
-                                (current-source-location)))))
+  (let ((finalize (compose (cut package-with-explicit-inputs <> %boot6-inputs
+                                (current-source-location))
+                           package-with-bootstrap-guile)))
     `(,@(map (match-lambda
-              ((name package)
-               (list name (finalize package))))
+               ((name package)
+                (list name (finalize package))))
              `(("tar" ,tar)
                ("gzip" ,gzip)
                ("bzip2" ,bzip2)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]