From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AHadKM2DEGDDQQAA0tVLHw (envelope-from ) for ; Tue, 26 Jan 2021 21:04:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CLN6JM2DEGDKEAAAB5/wlQ (envelope-from ) for ; Tue, 26 Jan 2021 21:04:13 +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 078E2940481 for ; Tue, 26 Jan 2021 21:04:12 +0000 (UTC) Received: from localhost ([::1]:33670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4VVT-00020g-RK for larch@yhetil.org; Tue, 26 Jan 2021 16:04:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4VSQ-0000UQ-MC for guix-patches@gnu.org; Tue, 26 Jan 2021 16:01:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4VSQ-0000SU-DL for guix-patches@gnu.org; Tue, 26 Jan 2021 16:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4VSQ-0004vI-8j for guix-patches@gnu.org; Tue, 26 Jan 2021 16:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45893] [PATCH 0/2] DRAFT: Hint for options. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Jan 2021 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45893 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Received: via spool by 45893-submit@debbugs.gnu.org id=B45893.161169484818896 (code B ref 45893); Tue, 26 Jan 2021 21:01:02 +0000 Received: (at 45893) by debbugs.gnu.org; 26 Jan 2021 21:00:48 +0000 Received: from localhost ([127.0.0.1]:42765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4VSB-0004ui-Vk for submit@debbugs.gnu.org; Tue, 26 Jan 2021 16:00:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4VSB-0004uW-Cu for 45893@debbugs.gnu.org; Tue, 26 Jan 2021 16:00:47 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60301) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4VS1-0000Fh-UE; Tue, 26 Jan 2021 16:00:42 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42840 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l4VS0-00008D-M6; Tue, 26 Jan 2021 16:00:37 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <865z3xlp2y.fsf@gmail.com> <20210116002634.10401-1-zimon.toutoune@gmail.com> <20210116002634.10401-3-zimon.toutoune@gmail.com> <87a6t4hlom.fsf_-_@gnu.org> <86o8hk8olh.fsf@gmail.com> Date: Tue, 26 Jan 2021 22:00:35 +0100 In-Reply-To: <86o8hk8olh.fsf@gmail.com> (zimoun's message of "Wed, 20 Jan 2021 00:59:54 +0100") Message-ID: <87v9bjxvkc.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: 45893@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: 078E2940481 X-Spam-Score: -2.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: MUG8/LC1bEYC zimoun skribis: > Well, one question is: what is the status of Stream in Guile? Without > drifting the initial topic, I am interested by the answer because it > could be useful for =E2=80=9Cguix git log=E2=80=9D (avoid to traverse all= the history > tree before displaying but traverse when it is required, somehow). As discussed on IRC, there=E2=80=99s (srfi srfi-41). > (define (read-the-cache guess) > (map (lambda (name) > (identity name)) > (fold-available-packages > (lambda* (name version result > #:key supported? deprecated? > #:allow-other-keys) > (if (and supported? (not deprecated?)) > (cons name result) > result)) > '()))) Why =E2=80=98map=E2=80=99 here? :-) > scheme@(guix-user)> ,time (define foo (read-the-cache "macs-mgit")) > ;; 3.492591s real time, 4.523108s run time. 1.530055s spent in GC. 3.5s?! I have: --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(gnu packages) scheme@(guix-user)> ,time (define lst (fold-available-packages (lambda* (name version result #:key supported? deprecated? #:allow-other-keys) (if (and supported? (not deprecated?)) (cons name result) result)) '())) ;;; :2:6: warning: possibly unused local top-level variable `lst' ;; 0.093728s real time, 0.130037s run time. 0.065544s spent in GC. --8<---------------cut here---------------end--------------->8--- I assume you=E2=80=99re using =E2=80=98guix repl=E2=80=99 and the cache is = authoritative, meaning that GUIX_PACKAGE_PATH is unset and there=E2=80=99s no =E2=80=98-L= =E2=80=99 flag, right? > scheme@(guix-user)> ,profile (define foo (compute-distance "macs-mgit")) > % cumulative self=20=20=20=20=20=20=20=20=20=20=20=20=20 > time seconds seconds procedure > 44.68 51.86 1.83 guix/memoization.scm:100:0 > 17.55 0.72 0.72 hash-set! > 12.23 0.54 0.50 guix/utils.scm:863:2:mproc > 9.04 0.37 0.37 hash-ref OK, the naive memoizing implementation is inefficient, now we know. :-) Thanks, Ludo=E2=80=99.