GNU bug report logs - #44254
Performance of package input rewriting

Previous Next

Package: guix;

Reported by: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>

Date: Tue, 27 Oct 2020 13:27:01 UTC

Severity: normal

Tags: notabug

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 44254 <at> debbugs.gnu.org
Subject: bug#44254: Performance of package input rewriting
Date: Tue, 3 Nov 2020 09:23:43 +0100
[Message part 1 (text/plain, inline)]
Hi Ludo,

> I guess it’s easy to end up creating huge object graphs.  Here’s an
> example of an anti-pattern:
> 
>   (define a
>     ((package-input-rewriting x) ((package-input-rewriting y) p1))) 
> 
>   (define b
>     ((package-input-rewriting x) ((package-input-rewriting y) p2)))
> 
> The correct use is:
> 
>   (define transform
>     (package-input-rewriting (append x y)))
> 
>   (define a (transform p1))
>   (define b (transform p2))
that sounds like a section for the cookbook :)

> It seems to me that you’re redefining a dependency graph, node by node.
> Thus, you probably don’t need ‘package-input-rewriting’ here.  What you
> did in Guix-Science commit 972795a23cc9eb5a0bb1a2ffb5681d151fc4d4b0
> looks more appropriate to me, in terms of style and semantics.
Okay, got it. My initial concern was that rewriting the graph “by hand” (i.e.
alist-delete) would be tedious and error-prone.

Thank you very much,
Lars

-- 
Lars-Dominik Braun
Wissenschaftlicher Mitarbeiter/Research Associate
www.leibniz-psychology.org
ZPID - Leibniz-Institut für Psychologie /
ZPID - Leibniz Institute for Psychology
Universitätsring 15
D-54296 Trier - Germany
Tel.: +49–651–201-4964
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.