summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-20 18:44:29 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-12 23:37:13 +0100
commitc6080c3249560ef777b9a4eb6a78e7605b8b98d8 (patch)
treedf4d2676a8ca18949f4ff3c9e1d6d54ca7aa8a9b /guix/gexp.scm
parent9ed86fe175c15c819d6d86681c8136ff6bc927c0 (diff)
downloadgnu-guix-c6080c3249560ef777b9a4eb6a78e7605b8b98d8.tar
gnu-guix-c6080c3249560ef777b9a4eb6a78e7605b8b98d8.tar.gz
store: Add a functional object cache and use it in 'lower-object'.
This leads to ~25% improvements on things like: guix system build desktop.tmpl --no-grafts -d * guix/store.scm (<nix-server>)[object-cache]: New field. * guix/store.scm (open-connection): Initialize it. (cache-object-mapping, lookup-cached-object, %mcached): New procedures. (mcached): New macro. * guix/gexp.scm (lower-object): Use it. * guix/grafts.scm (grafting?): New procedure.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 537875b6b7..f33fb198e4 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -211,7 +211,12 @@ OBJ must be an object that has an associated gexp compiler, such as a
(#f
(raise (condition (&gexp-input-error (input obj)))))
(lower
- (lower obj system target))))
+ ;; Cache in STORE the result of lowering OBJ.
+ (mlet %store-monad ((graft? (grafting?)))
+ (mcached (let ((lower (lookup-compiler obj)))
+ (lower obj system target))
+ obj
+ system target graft?)))))
(define-syntax define-gexp-compiler
(syntax-rules (=> compiler expander)