guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/05: grafts: Preserve the cache across recursive calls.


From: Ludovic Courtès
Subject: 02/05: grafts: Preserve the cache across recursive calls.
Date: Mon, 16 Jan 2017 21:13:51 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 0aeed5e310504a9ef2cf6a2b2a7e76086eb8c2fc
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 16 22:05:43 2017 +0100

    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(-)

diff --git a/guix/grafts.scm b/guix/grafts.scm
index b60c8cf..e14a40f 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)))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]