[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/10: grafts: Record cache lookups for profiling.
From: |
guix-commits |
Subject: |
06/10: grafts: Record cache lookups for profiling. |
Date: |
Tue, 8 Jun 2021 03:33:47 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 6bd3d4fe06a65db5356f4eec43a505a47acc3934
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri May 28 17:45:38 2021 +0200
grafts: Record cache lookups for profiling.
* guix/grafts.scm (record-cache-lookup!): New procedure.
(with-cache): Use it.
---
guix/grafts.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/guix/grafts.scm b/guix/grafts.scm
index fd8a108..dff3d75 100644
--- a/guix/grafts.scm
+++ b/guix/grafts.scm
@@ -172,10 +172,16 @@ references."
items))))
(remove (cut member <> self) refs)))
+(define record-cache-lookup!
+ (cache-lookup-recorder "derivation-graft-cache"
+ "Derivation graft cache"))
+
(define-syntax-rule (with-cache key exp ...)
"Cache the value of monadic expression EXP under KEY."
- (mlet %state-monad ((cache (current-state)))
- (match (vhash-assoc key cache)
+ (mlet* %state-monad ((cache (current-state))
+ (result -> (vhash-assoc key cache)))
+ (record-cache-lookup! result cache)
+ (match result
((_ . result) ;cache hit
(return result))
(#f ;cache miss
- branch master updated (61bce4d -> 0c10902), guix-commits, 2021/06/08
- 01/10: news: Fix typo., guix-commits, 2021/06/08
- 03/10: gnu: pantheon: Use modern 'define-module' syntax., guix-commits, 2021/06/08
- 02/10: doc: Update minimum Guile-Git version., guix-commits, 2021/06/08
- 04/10: store: Support dynamic allocation of per-connection caches., guix-commits, 2021/06/08
- 05/10: store: Generalize cache lookup recording., guix-commits, 2021/06/08
- 06/10: grafts: Record cache lookups for profiling.,
guix-commits <=
- 07/10: grafts: Use SRFI-71 instead of SRFI-11., guix-commits, 2021/06/08
- 08/10: store: Remove 'references/substitutes'., guix-commits, 2021/06/08
- 09/10: store: 'references/cached' now uses a per-session cache., guix-commits, 2021/06/08
- 10/10: grafts: Cache the derivation/graft mapping for the whole session., guix-commits, 2021/06/08