diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-02-19 10:18:48 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-02-23 15:24:49 +0100 |
commit | c8bd5fa59c4493734fa41f6c4d5b972ba8b5b141 (patch) | |
tree | aaafa3e75f1af054b8428646ef57d574942bcf1e /gnu/system.scm | |
parent | b57de6fea126f907a873ae14ad8b32dc32456e8e (diff) | |
download | guix-c8bd5fa59c4493734fa41f6c4d5b972ba8b5b141.tar.gz guix-c8bd5fa59c4493734fa41f6c4d5b972ba8b5b141.zip |
gexp: Reduce allocations while traversing lists.
This reduces the total amount of memory allocated by 8% when running
"guix build qemu -d --no-grafts".
* guix/gexp.scm (fold/tree): New procedure.
(gexp-inputs)[interesting?]: New procedure.
[add-reference-inputs]: Change (lst ...) clause to (? pair? lst), and
use 'fold/tree' to recurse into it.
(gexp-inputs)[add-reference-output]: Likewise, and remove
plain (lst ...) clause.
Call 'fold'.
(gexp->sexp)[reference->sexp]: In the list case, avoid boxing and
recursive call when the object has a plain non-aggregate type.
Diffstat (limited to 'gnu/system.scm')
0 files changed, 0 insertions, 0 deletions