~ruther/guix-local

0aeed5e310504a9ef2cf6a2b2a7e76086eb8c2fc — Ludovic Courtès 9 years ago 90ad5c8
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.
1 files changed, 2 insertions(+), 1 deletions(-)

M guix/grafts.scm
M guix/grafts.scm => guix/grafts.scm +2 -1
@@ 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)))))))