From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] Optimize package-transitive-supported-systems Date: Mon, 22 Dec 2014 00:37:54 +0100 Message-ID: <871tnspoa5.fsf@gnu.org> References: <873888n0g4.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2q4b-0003Yl-SL for guix-devel@gnu.org; Sun, 21 Dec 2014 18:38:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2q4V-0005ih-Ov for guix-devel@gnu.org; Sun, 21 Dec 2014 18:38:05 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:53905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2q4V-0005iU-JA for guix-devel@gnu.org; Sun, 21 Dec 2014 18:37:59 -0500 In-Reply-To: <873888n0g4.fsf@netris.org> (Mark H. Weaver's message of "Sun, 21 Dec 2014 16:43:23 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org Mark H Weaver skribis: > When hydra evaluates a jobset, 'package-transitive-supported-systems' is > called for every package+system combination. Each of these calls > traverses the tree of inputs, but without eliminating duplicate > transitive-inputs. In other words, the amount of time spent is > proportional not to the number of transitive-inputs, but the number of > _paths_ to all transitive-inputs. Oops! Though it=E2=80=99s not clear to me that it explains the problems we= =E2=80=99re seeing on Hydra currently, because running build-aux/hydra/gnu-system.scm on my laptop takes ~1mn. > This patch memoizes 'package-transitive-supported-systems', so that the > total time to apply it to all packages is O(N). Much better. > From 90541f6c7e2a9e2f8a7b412532b4b5a56a10e481 Mon Sep 17 00:00:00 2001 > From: Mark H Weaver > Date: Sun, 21 Dec 2014 16:21:02 -0500 > Subject: [PATCH] Optimize package-transitive-supported-systems. > > * guix/packages.scm (first-value): Remove. > (define-memoized/v): New macro. > (package-transitive-supported-systems): Rewrite. LGTM, thank you! Ludo=E2=80=99.