From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 5VFhCQH1EWBKQgAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 23:19:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +L52BAH1EWDAMQAAbx9fmQ (envelope-from ) for ; Wed, 27 Jan 2021 23:19:29 +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 A45899403E7 for ; Wed, 27 Jan 2021 23:19:28 +0000 (UTC) Received: from localhost ([::1]:48090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4u5v-0000RV-LR for larch@yhetil.org; Wed, 27 Jan 2021 18:19:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4u5W-0000RJ-PF for guix-patches@gnu.org; Wed, 27 Jan 2021 18:19:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4u5W-0005qr-H7 for guix-patches@gnu.org; Wed, 27 Jan 2021 18:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4u5W-0002HH-Ci for guix-patches@gnu.org; Wed, 27 Jan 2021 18:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46100] [PATCH 0/4] Memoize inferior package access. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Jan 2021 23:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46100 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ricardo Wurmus Received: via spool by 46100-submit@debbugs.gnu.org id=B46100.16117894988679 (code B ref 46100); Wed, 27 Jan 2021 23:19:02 +0000 Received: (at 46100) by debbugs.gnu.org; 27 Jan 2021 23:18:18 +0000 Received: from localhost ([127.0.0.1]:46444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4u4o-0002Fu-0I for submit@debbugs.gnu.org; Wed, 27 Jan 2021 18:18:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4u4l-0002Fi-Tc for 46100@debbugs.gnu.org; Wed, 27 Jan 2021 18:18:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57349) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4u4g-0005mq-GA; Wed, 27 Jan 2021 18:18:10 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55806 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l4u4g-0005x6-00; Wed, 27 Jan 2021 18:18:10 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210125133738.15609-1-rekado@elephly.net> <20210125133738.15609-2-rekado@elephly.net> <878s8g0yln.fsf_-_@gnu.org> <874kj40wbp.fsf_-_@gnu.org> <87y2gfj2ks.fsf@elephly.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?UTF-8?Q?Pluvi=C3=B4se?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 28 Jan 2021 00:18:08 +0100 In-Reply-To: <87y2gfj2ks.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 26 Jan 2021 13:38:11 +0100") Message-ID: <87sg6mrmtr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: 46100@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: A45899403E7 X-Spam-Score: -2.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: akgwDULRfh0C Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: > >> Ludovic Court=C3=A8s skribis: >> >>> There=E2=80=99s a catch here: OUTPUT should be taken into account. >>> >>> Also it=E2=80=99s better to use eq?-ness but=E2=80=A6 I realized >>> =E2=80=98inferior-package-inputs=E2=80=99 & co. do not preserve eq?-nes= s. >> >> I think I went overboard here: given that is a simple >> flat record type, using =E2=80=98equal?=E2=80=99/=E2=80=98hash-ref=E2=80= =99 is reasonable and that way >> we avoid the troubles of building an ID-to-package table. All in all >> it=E2=80=99s slightly more efficient. > > This looks good to me. > > It is very similar to my first version (which I didn=E2=80=99t send to the > list), which also built a key consisting of the arguments to > inferior-package->manifest-entry =E2=80=94 I wasn=E2=80=99t sure which of= them was > important so I used them all instead of just consing package and > output. > > I also like the use of define-syntax-rule to make it all look neater. I pushed it as 0f20b3fa2050ba6e442e340a204516b9375cd231. I wonder if the other patches improve the situation. If you run the same test case with: GUIX_PROFILING=3Dmemoization what hit rates does it show for these spots? Thanks, Ludo=E2=80=99.