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 0G19EsCPEGCzIAAA0tVLHw (envelope-from ) for ; Tue, 26 Jan 2021 21:55:12 +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 WA5ADsCPEGCJBAAAbx9fmQ (envelope-from ) for ; Tue, 26 Jan 2021 21:55:12 +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 71E2F940481 for ; Tue, 26 Jan 2021 21:55:11 +0000 (UTC) Received: from localhost ([::1]:46016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4WIo-0005nZ-BR for larch@yhetil.org; Tue, 26 Jan 2021 16:55:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4WIg-0005n6-KQ for guix-patches@gnu.org; Tue, 26 Jan 2021 16:55:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4WIg-0001f2-CC for guix-patches@gnu.org; Tue, 26 Jan 2021 16:55:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4WIg-0006EE-AW for guix-patches@gnu.org; Tue, 26 Jan 2021 16:55:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45893] [PATCH 0/2] DRAFT: Hint for options. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Jan 2021 21:55: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 45893-submit@debbugs.gnu.org id=B45893.161169804823877 (code B ref 45893); Tue, 26 Jan 2021 21:55:02 +0000 Received: (at 45893) by debbugs.gnu.org; 26 Jan 2021 21:54:08 +0000 Received: from localhost ([127.0.0.1]:42838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4WHn-0006D3-NB for submit@debbugs.gnu.org; Tue, 26 Jan 2021 16:54:07 -0500 Received: from mail-wr1-f45.google.com ([209.85.221.45]:44045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4WHl-0006CZ-VQ for 45893@debbugs.gnu.org; Tue, 26 Jan 2021 16:54:06 -0500 Received: by mail-wr1-f45.google.com with SMTP id d16so17402691wro.11 for <45893@debbugs.gnu.org>; Tue, 26 Jan 2021 13:54:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=gBHc5CrxxHjDbk8kKKLDZpcZAI1nbmlfG7lVMKpoCw4=; b=O1THr48fOvKi4QsDbarmtdXC1ubWYit6YVaHozjkDXv9j0l8HVPzwqUaOgrUALBymt ccdsJjGyjGdhw6JepJ/GRunBt+SNPhsuOIef2POEehzR8QqWu7NwXyfeMCH8bwfTWMwl 1wrl8oTD5Erjp8Vrn3A6sONhF/ijPXoDa/ZCWP84Rsr/+DjBGzZbNh6/Rew59hYP+o8t NFx2AJjmg7OeH2yo1l2uJhARuUywkj6GRyQCbWqPLrFZafAI5EZo/9vA+t4Q55oGrwLF yvNYn4ArrDq2qB/C8vplWG6f2I0oqe9U2dWTdxLp1N9NnzP9kTNFGbC8YxZZC96wj+4R qkAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=gBHc5CrxxHjDbk8kKKLDZpcZAI1nbmlfG7lVMKpoCw4=; b=UZzZXb0mKarEEKotj8tLRAKXAPlZcDLn+S33Mkwabq6eY+9guCqffgtbvLBZ6lNJCt 4dMLNehoO9Q7A+M+WNbGuq/Ue4qOgF24mxnC6WW4miuwMQlY3+eYoB49dCKJhlbMwdR9 bRxRcq3/nwtIWzdy2GNaeVqHLrmwU21Ihhqpxq0k8s/fhkU7uFlao0d+wR0T5d+yPDec pCohLzboUKgNQbiPhk93WWjJ3C3HnBL95MYZo1ePEcNKJpSBTuInDKXsMiDiw+rGvFMX LCLB/1GXc/lHFaXbZoPgcjU5jpIEK+yw9BWlqhqMt0PorPUU9X1KB4u23PVjGictXHWw 35kg== X-Gm-Message-State: AOAM5308Drx6U/SK/nnIznA6zrlNdiY6f8W95imdQ6Jd/W3uW6zFF0dU ucCjGEMistyAxlACbKorfkncYLj1OC4= X-Google-Smtp-Source: ABdhPJye7usgZN0N3tLTHu/WCVivyuv1HTLypQ91vsxPJHn8c6CzHaCAZGsViu5UeWcoK19um9ih/g== X-Received: by 2002:a5d:4a50:: with SMTP id v16mr8197622wrs.241.1611698039901; Tue, 26 Jan 2021 13:53:59 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id c16sm45064wrx.51.2021.01.26.13.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 13:53:59 -0800 (PST) From: zimoun 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> <87v9bjxvkc.fsf_-_@gnu.org> Date: Tue, 26 Jan 2021 22:44:46 +0100 In-Reply-To: <87v9bjxvkc.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 26 Jan 2021 22:00:35 +0100") Message-ID: <86o8hbid9t.fsf@gmail.com> 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: -1.25 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=O1THr48f; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 71E2F940481 X-Spam-Score: -1.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: B+6pUv7z1UrR Hi, On Tue, 26 Jan 2021 at 22:00, Ludovic Court=C3=A8s wrote: > As discussed on IRC, there=E2=80=99s (srfi srfi-41). I am playing with it. Thanks! :-) >> (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? :-) Good question! Burn CPU? :-) >> 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: > > 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. > > I assume you=E2=80=99re using =E2=80=98guix repl=E2=80=99 and the cache i= s authoritative, > meaning that GUIX_PACKAGE_PATH is unset and there=E2=80=99s no =E2=80=98-= L=E2=80=99 flag, > right? Yes. GUIX_PACKAGE_PATH unset and no =E2=80=99-L=E2=80=99 flag. So, it sho= uld be worse otherwise.=20=20 Well, I am surprise by the timing difference. I do not remember on which machine I did: maybe an old desktop with spinning disks at work. >> 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. :-) =E2=80=99memoize=E2=80=99 or =E2=80=99mlambda=E2=80=99? Or both? Well, th= e thread is mess up to I do not remember which one had been used. On the other hand, the naive recursive edit distance is well know to be slow and ineffective. Cheers, simon