[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/11: gexp: Cache the module to derivation mappings.
From: |
guix-commits |
Subject: |
05/11: gexp: Cache the module to derivation mappings. |
Date: |
Sun, 27 Oct 2019 18:13:08 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f5fca9a82cec76d2e10b8b6c96be2dd79f638ba0
Author: Ludovic Courtès <address@hidden>
Date: Sun Oct 27 19:12:11 2019 +0100
gexp: Cache the module to derivation mappings.
This reduces the number of 'add-data-to-store' cache lookups from 3329
to 2743 (hit rate: 27% to 11%) when running:
GUIX_PROFILING=add-data-to-store-cache guix build libreoffice -nd
Execution time of "guix build libreoffice -nd" goes from 1.86s to 1.80s.
* guix/gexp.scm (imported+compiled-modules): Wrap body in 'mcached'.
---
guix/gexp.scm | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index fa74e80..b640c07 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -660,21 +660,24 @@ names and file names suitable for the
#:allowed-references argument to
(module-path %load-path))
"Return a pair where the first element is the imported MODULES and the
second element is the derivation to compile them."
- (mlet %store-monad ((modules (if (pair? modules)
- (imported-modules modules
- #:system system
- #:module-path
module-path)
- (return #f)))
- (compiled (if (pair? modules)
- (compiled-modules modules
- #:system system
- #:module-path module-path
- #:extensions extensions
- #:guile guile
- #:deprecation-warnings
- deprecation-warnings)
- (return #f))))
- (return (cons modules compiled))))
+ (mcached equal?
+ (mlet %store-monad ((modules (if (pair? modules)
+ (imported-modules modules
+ #:system system
+ #:module-path
module-path)
+ (return #f)))
+ (compiled (if (pair? modules)
+ (compiled-modules modules
+ #:system system
+ #:module-path
module-path
+ #:extensions
extensions
+ #:guile guile
+
#:deprecation-warnings
+
deprecation-warnings)
+ (return #f))))
+ (return (cons modules compiled)))
+ modules
+ system extensions guile deprecation-warnings module-path))
(define* (lower-gexp exp
#:key
- branch master updated (6d18427 -> b13b938), guix-commits, 2019/10/27
- 02/11: derivations: 'build-expression->derivation' caches its module derivations., guix-commits, 2019/10/27
- 01/11: derivations: Introduce 'imported+compiled-modules'., guix-commits, 2019/10/27
- 04/11: store: Allow objects in the cache to be inserted and search for with 'equal?'., guix-commits, 2019/10/27
- 03/11: gexp: Add 'imported+compiled-modules'., guix-commits, 2019/10/27
- 10/11: pull: Honor '/etc/guix/channels.scm'., guix-commits, 2019/10/27
- 08/11: gnu: bootstrap: Cache the 'bootstrap-executable' origins., guix-commits, 2019/10/27
- 06/11: derivations: Don't memoize 'derivation->bytevector'., guix-commits, 2019/10/27
- 05/11: gexp: Cache the module to derivation mappings.,
guix-commits <=
- 11/11: news: Add entry for /etc/guix/channels.scm., guix-commits, 2019/10/27
- 07/11: gnu: bootstrap: 'bootstrap-origin' preserves eq?-ness when no changes are made., guix-commits, 2019/10/27
- 09/11: channels: Refer to 'guile-json-3'., guix-commits, 2019/10/27