diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-05-28 17:32:58 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-06-08 09:25:50 +0200 |
commit | 0c109026093e6fa8730efe0d7454656275d6efe3 (patch) | |
tree | 22658c44219f72ef303fbb1cb129005da3b04db1 /tests/guix-graph.sh | |
parent | fde3c349f511ac1237099511b5bdba5fbf541879 (diff) | |
download | guix-patches-0c109026093e6fa8730efe0d7454656275d6efe3.tar guix-patches-0c109026093e6fa8730efe0d7454656275d6efe3.tar.gz |
grafts: Cache the derivation/graft mapping for the whole session.
Partly fixes <https://bugs.gnu.org/41702>.
Reported by Lars-Dominik Braun <ldb@leibniz-psychology.org>.
Previously, 'graft-derivation' would start anew at every call. When
creating a profile with lots of packages, it would potentially do the
same work multiple times. The per-session cache addresses this. It
increases the derivation-graft-cache hit rate from 77.9% to 80.1% on:
GUIX_PROFILING="derivation-graft-cache" ./pre-inst-env \
guix environment --ad-hoc libreoffice inkscape krita darktable -n
The effect is more visible on the pathological case below, where cache
hit rate goes from 75% to 87% and wall-clock time from 5.0s to 3.5s:
GUIX_PROFILING="derivation-graft-cache" ./pre-inst-env \
guix environment --ad-hoc r-learnr --search-paths
* guix/grafts.scm (%graft-cache): New variable.
(graft-derivation): Add calls to 'store-connection-cache' and
'set-store-connection-cache!'.
Diffstat (limited to 'tests/guix-graph.sh')
0 files changed, 0 insertions, 0 deletions