From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YIE+Aw/JDmD9CgAA0tVLHw (envelope-from ) for ; Mon, 25 Jan 2021 13:35:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2EawOg7JDmDdcgAA1q6Kng (envelope-from ) for ; Mon, 25 Jan 2021 13:35:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4D3EA94042F for ; Mon, 25 Jan 2021 13:35:10 +0000 (UTC) Received: from localhost ([::1]:45762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l421N-0008Pt-5U for larch@yhetil.org; Mon, 25 Jan 2021 08:35:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l421G-0008Pi-LI for guix-patches@gnu.org; Mon, 25 Jan 2021 08:35:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l421G-0003A9-E3; Mon, 25 Jan 2021 08:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l421G-0001og-8M; Mon, 25 Jan 2021 08:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46100] [PATCH 0/4] Memoize inferior package access. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 25 Jan 2021 13:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46100 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46100@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by submit@debbugs.gnu.org id=B.16115816566908 (code B ref -1); Mon, 25 Jan 2021 13:35:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jan 2021 13:34:16 +0000 Received: from localhost ([127.0.0.1]:38223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l420W-0001nM-AB for submit@debbugs.gnu.org; Mon, 25 Jan 2021 08:34:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:39872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l420U-0001nB-BG for submit@debbugs.gnu.org; Mon, 25 Jan 2021 08:34:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l420U-0008Bz-4H for guix-patches@gnu.org; Mon, 25 Jan 2021 08:34:14 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l420O-0002ou-Bh for guix-patches@gnu.org; Mon, 25 Jan 2021 08:34:13 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1611581645; cv=none; d=zohomail.com; s=zohoarc; b=PMrl9QLDCFsYoEtDcW0/2gBNdVNw7f+CJLxYYH3JK6iPdvXbCMSPIPEepAOnoLRGzi5yU+qdVsvdjrF20CWFFQmEADy1iNnFSroirjF7fLAwv9xeNFv0KRQzSXTfjmJq4/Q6NONJYYlJoAuMKOGDbe1iGFMziTG6GktLZcUGxes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611581645; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=qF0zhHqy+nryUb7GTsJDkYtoU8V7da9/1ViYVVIj7KA=; b=RmhZ+97qouiASaMyTb7972JZtF2NpMz7ZbViSJS+vQAUlZ4ovoM8UG7HC6mL3Z9JuhabEeY4C3cJccFOx2SujSEEFdCCVG8bou+f6HYbsEoqGX3d0YAynBzO4uuCPIvTafPWfw/NW0Gi2+KshrveFcMaMBDSmohZDhnVXZSrxMw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1611581645; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=qF0zhHqy+nryUb7GTsJDkYtoU8V7da9/1ViYVVIj7KA=; b=SFwSzgB60OFgvf3Vfm1DNBgrbvD+5Qrh2AkcThmcdgVOHM9aj5v0QqNXcmt4Jyti Dr2HbFadQv8O96JIFGqX+03vVznHoJGzHsXt9CFEPCpI/mH1dkEe3OtRejrWy2/IcHq 5uaX7b+Ib36P9CUWWkbcDc954T51YK5bW/mdXl/s= Received: from localhost (p54ad4ec7.dip0.t-ipconnect.de [84.173.78.199]) by mx.zohomail.com with SMTPS id 1611581642477896.3441745357472; Mon, 25 Jan 2021 05:34:02 -0800 (PST) User-agent: mu4e 1.4.13; emacs 27.1 From: Ricardo Wurmus X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Mon, 25 Jan 2021 14:33:59 +0100 Message-ID: <87k0s1jg3c.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-ZohoMailClient: External X-Zoho-Virus-Status: 1 Received-SPF: pass client-ip=136.143.188.51; envelope-from=rekado@elephly.net; helo=sender4-of-o51.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 1.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elephly.net header.s=zoho header.b=SFwSzgB6; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 4D3EA94042F X-Spam-Score: 1.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: Y+EBULyYbX8b --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Guix, this patch set improves performance of inferior lookups by caching previous results. The change in inferior-package->manifest-entry has the biggest impact in my test case, where I'm building a profile consisting of a few R packages. Without this patch it takes more than 14 seconds. With cached results it takes less than a second. Included is a patch that Ludo provided on #guix-hpc for which I wrote a commit message. The test case is attached. Ludovic Court=C3=A8s (1): inferior: Memoize package input field access. Ricardo Wurmus (3): guix: Fix typo. inferior: Memoize inferior-package->manifest-entry. inferior: Memoize inferior package search path access. guix/inferior.scm | 155 ++++++++++++++++++++++++---------------------- 1 file changed, 81 insertions(+), 74 deletions(-) base-commit: 90a6ce0b1852608185e3ba7fe09e585b43eac3be --=20 2.29.2 --=20 Ricardo --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=inferior-slow.scm (import (guix packages) (guix inferior) (guix store) (guix monads)(guix gexp) (guix profiles) (guix derivations) (ice-9 match) (srfi srfi-19)) (pk 'current-guix) (define current-guix ;; /home/rekado/.config/guix/current (let* ((default-guix "/gnu/store/ig6alp71w39bmfy51f1w32z0k2rbh6ra-profile") (current-guix-inferior #false)) (lambda () (or current-guix-inferior (begin (set! current-guix-inferior (open-inferior (canonicalize-path default-guix))) current-guix-inferior))))) (define (lookup-package specification) (match (lookup-inferior-packages (current-guix) specification) ((first . rest) first) (x (error "oops" x)))) (define specs (list "bash-minimal" "r-minimal" "r-ggplot2" "r-ggrepel" "r-deseq2" "r-dt" "r-pheatmap" "r-corrplot" "r-reshape2" "r-plotly" "r-scales" "r-crosstalk" "r-gprofiler" "r-rtracklayer" "r-summarizedexperiment")) (pk 'packages) (define packages (map lookup-package specs)) (pk 'packages->manifest) (let ((start (current-time))) (let ((manifest (packages->manifest packages))) (pk 'packages->manifest-done (time-difference (current-time) start)))) --=-=-=--