inferior: Speed up 'cached-channel-instance' for cache hits.
authorLudovic Courtès <ludo@gnu.org>
Thu, 28 Jan 2021 21:48:21 +0000 (22:48 +0100)
committerLudovic Courtès <ludo@gnu.org>
Fri, 29 Jan 2021 11:09:11 +0000 (12:09 +0100)
commit7cfd789150f448cf5256b88915bae4163cc9db03
tree353a5afca4a8ae6ee34588b25b338eaa06696c9c
parentd7db38341af57e7eb8cff96f899e7b9fa96d92f6
inferior: Speed up 'cached-channel-instance' for cache hits.

That way a command like:

  guix time-machine --commit=5aeee07cc9 -- describe

goes from 3.4s to 0.5s on a cache hit, even slightly less when passing
the full commit ID.

* guix/inferior.scm (channel-full-commit): New procedure.
(cached-channel-instance): Remove 'instances' top-level variable.  Add
'commits' and use it for 'key'.  Move 'latest-channel-instances' call to
the cache miss case.
guix/inferior.scm