[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/20: store: Object cache profiling shows the number of entries.
From: |
guix-commits |
Subject: |
10/20: store: Object cache profiling shows the number of entries. |
Date: |
Mon, 1 Mar 2021 09:32:10 -0500 (EST) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 168829541d0210895e3e52e5d50cdce3eb8c95ed
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Feb 18 22:25:18 2021 +0100
store: Object cache profiling shows the number of entries.
* guix/store.scm (record-cache-lookup!): Add 'size' variable; keep it
up-to-date and display it.
---
guix/store.scm | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/guix/store.scm b/guix/store.scm
index 81bb9eb..dccf8ba 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1835,18 +1835,21 @@ and RESULT is typically its derivation."
(if (profiled? "object-cache")
(let ((fresh 0)
(lookups 0)
- (hits 0))
+ (hits 0)
+ (size 0))
(register-profiling-hook!
"object-cache"
(lambda ()
(format (current-error-port) "Store object cache:
fresh caches: ~5@a
lookups: ~5@a
- hits: ~5@a (~,1f%)~%"
+ hits: ~5@a (~,1f%)
+ cache size: ~5@a entries~%"
fresh lookups hits
(if (zero? lookups)
100.
- (* 100. (/ hits lookups))))))
+ (* 100. (/ hits lookups)))
+ size)))
(lambda (hit? cache)
(set! fresh
@@ -1854,7 +1857,9 @@ and RESULT is typically its derivation."
(+ 1 fresh)
fresh))
(set! lookups (+ 1 lookups))
- (set! hits (if hit? (+ hits 1) hits))))
+ (set! hits (if hit? (+ hits 1) hits))
+ (set! size (+ (if hit? 0 1)
+ (vlist-length cache)))))
(lambda (x y)
#t)))
- 01/20: build-system: Rewrite using gexps., (continued)
- 01/20: build-system: Rewrite using gexps., guix-commits, 2021/03/01
- 07/20: gexp: 'gexp-inputs' returns both native and non-native inputs., guix-commits, 2021/03/01
- 03/20: packages: Simplify patch instantiation., guix-commits, 2021/03/01
- 09/20: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., guix-commits, 2021/03/01
- 12/20: grafts: Inline 'grafting?' and 'set-grafting'., guix-commits, 2021/03/01
- 15/20: serialization: Micro-optimize string literal output in 'write-file-tree'., guix-commits, 2021/03/01
- 16/20: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/01
- 17/20: packages: Default origin 'patch-flags' is a gexp., guix-commits, 2021/03/01
- 18/20: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/01
- 08/20: gexp: Keep 'lower-inputs' private., guix-commits, 2021/03/01
- 10/20: store: Object cache profiling shows the number of entries.,
guix-commits <=
- 11/20: gexp: Reduce allocations while traversing lists., guix-commits, 2021/03/01
- 06/20: gexp: 'gexp-inputs' returns a list of <gexp-input> records., guix-commits, 2021/03/01
- 13/20: store: Micro-optimize object cache lookup., guix-commits, 2021/03/01
- 14/20: gexp: Reduce allocations in 'gexp-attribute'., guix-commits, 2021/03/01
- 20/20: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/01
- 19/20: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/01