[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/29: store: Micro-optimize object cache lookup.
From: |
guix-commits |
Subject: |
02/29: store: Micro-optimize object cache lookup. |
Date: |
Mon, 8 Mar 2021 06:24:47 -0500 (EST) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit c7e9beeb2ca4e1255fe81fc6507dbc91daa30e65
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Feb 19 22:30:30 2021 +0100
store: Micro-optimize object cache lookup.
This avoids a closure allocation when 'lookup-cached-object' is called.
* guix/store.scm (lookup-cached-object): Avoid optional/keyword
arguments and inline.
(%mcached): Adjust accordingly.
---
guix/store.scm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/guix/store.scm b/guix/store.scm
index dccf8ba..37ae6cf 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1863,8 +1863,7 @@ and RESULT is typically its derivation."
(lambda (x y)
#t)))
-(define* (lookup-cached-object object #:optional (keys '())
- #:key (vhash-fold* vhash-foldq*))
+(define-inlinable (lookup-cached-object object keys vhash-fold*)
"Return the cached object in the store connection corresponding to OBJECT
and KEYS; use VHASH-FOLD* to look for OBJECT in the cache. KEYS is a list of
additional keys to match against, and which are compared with 'equal?'.
@@ -1895,7 +1894,7 @@ Return #f on failure and the cached result otherwise."
OBJECT/KEYS, or return its cached value. Use VHASH-CONS to insert OBJECT into
the cache, and VHASH-FOLD* to look it up."
(mlet %store-monad ((cached (lookup-cached-object object keys
- #:vhash-fold*
vhash-fold*)))
+ vhash-fold*)))
(if cached
(return cached)
(>>= (mthunk)
- 08/29: gexp: Keep 'lower-inputs' private., (continued)
- 08/29: gexp: Keep 'lower-inputs' private., guix-commits, 2021/03/08
- 01/29: store: Object cache profiling shows the number of entries., guix-commits, 2021/03/08
- 06/29: gexp: 'gexp-inputs' returns a list of <gexp-input> records., guix-commits, 2021/03/08
- 07/29: gexp: 'gexp-inputs' returns both native and non-native inputs., guix-commits, 2021/03/08
- 11/29: gexp: Reduce allocations in 'gexp-attribute'., guix-commits, 2021/03/08
- 09/29: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., guix-commits, 2021/03/08
- 13/29: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/08
- 10/29: gexp: Reduce allocations while traversing lists., guix-commits, 2021/03/08
- 20/29: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/08
- 21/29: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/08
- 02/29: store: Micro-optimize object cache lookup.,
guix-commits <=
- 28/29: grafts: Add 'without-grafting'., guix-commits, 2021/03/08
- 29/29: gexp: Allowed/disallowed references and graphs never refer to grafted inputs., guix-commits, 2021/03/08
- 14/29: build-system: Rewrite using gexps., guix-commits, 2021/03/08
- 15/29: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/08
- 16/29: packages: Simplify patch instantiation., guix-commits, 2021/03/08
- 25/29: tests: Refer to '%derivation-cache' in the right module., guix-commits, 2021/03/08
- 26/29: packages: 'expand-input' accepts any file-like object., guix-commits, 2021/03/08
- 17/29: packages: Core procedures are written in monadic style., guix-commits, 2021/03/08
- 19/29: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/08
- 05/29: gexp: Micro-optimize sexp serialization., guix-commits, 2021/03/08