From 0aeed5e310504a9ef2cf6a2b2a7e76086eb8c2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 16 Jan 2017 22:05:43 +0100 Subject: grafts: Preserve the cache across recursive calls. Before this commit, we'd lose the cache across recursive calls to 'cumulative-grafts', which isn't great performance-wise. This bug was already present before d38bc9a9f6feefc465964531520fee5663a12f48. * guix/grafts.scm (with-cache): In the miss case, call 'current-state' after EXP has been evaluated. --- guix/grafts.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix/grafts.scm') diff --git a/guix/grafts.scm b/guix/grafts.scm index b60c8cfd90..e14a40f8d1 100644 --- a/guix/grafts.scm +++ b/guix/grafts.scm @@ -221,7 +221,8 @@ available." ((_ . result) ;cache hit (return result)) (#f ;cache miss - (mlet %state-monad ((result (begin exp ...))) + (mlet %state-monad ((result (begin exp ...)) + (cache (current-state))) (mbegin %state-monad (set-current-state (vhash-consq key result cache)) (return result))))))) -- cgit v1.2.3