From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kHixHWMMHGH6IQEAgWs5BA (envelope-from ) for ; Tue, 17 Aug 2021 21:22:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mLhPGWMMHGGNHgAAbx9fmQ (envelope-from ) for ; Tue, 17 Aug 2021 19:22:11 +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 AC317B4A9 for ; Tue, 17 Aug 2021 21:22:10 +0200 (CEST) Received: from localhost ([::1]:35902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mG4f3-0003SB-Db for larch@yhetil.org; Tue, 17 Aug 2021 15:22:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG4ex-0003S3-52 for guix-patches@gnu.org; Tue, 17 Aug 2021 15:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42605) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mG4ew-000403-5F for guix-patches@gnu.org; Tue, 17 Aug 2021 15:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mG4ew-0008Fj-1g for guix-patches@gnu.org; Tue, 17 Aug 2021 15:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH v6 1/2] DRAFT packages: Add fields to packages cache. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 17 Aug 2021 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Arun Isaac Cc: 39258@debbugs.gnu.org Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.162922806331642 (code B ref 39258); Tue, 17 Aug 2021 19:22:02 +0000 Received: (at 39258) by debbugs.gnu.org; 17 Aug 2021 19:21:03 +0000 Received: from localhost ([127.0.0.1]:54151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG4dy-0008EH-Ix for submit@debbugs.gnu.org; Tue, 17 Aug 2021 15:21:03 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:39881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG4dt-0008DR-2T for 39258@debbugs.gnu.org; Tue, 17 Aug 2021 15:21:01 -0400 Received: by mail-wr1-f45.google.com with SMTP id q6so18697627wrv.6 for <39258@debbugs.gnu.org>; Tue, 17 Aug 2021 12:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=NIYxTF9U5NbY2OrvQvqDpRT0W1LQEUqBfPBTP80BwtY=; b=isRdKSWUG/JP+sivjVLfzqFF4K7/ecfHVMCzZxtE9vw+VQTBC1WqZGTdtJfHodB+R+ 4lET0764HBUht0X1c6hLqeg0qkyJvfkeGe/IZBoRfm612C/YLZwKJGHLPIoTdMNYLmtR FlOrzVbmIQhHYJW4TWgMy97cn54YmZPPthxJ9HbmUtjEyNLHfSRdWqAw1qMNKPthwWWJ P46I9nI9ilsXHQLwIkf/tLAcu9cdiOxPzWP4T7IZdKeBvXJdAuaePPJNJb+G8txlY/pR tCcltqr7WdW9AceBKYCytoJOGk3g0BYO1wt6jUeHVjbppRNUuaIjJ4W6FJyS8pUlZUHU srqA== 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:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=NIYxTF9U5NbY2OrvQvqDpRT0W1LQEUqBfPBTP80BwtY=; b=MIs3aDhLLPXNOiWV6+DYZkXtV5V+uZWW1wQ9gM9fMm9TBugnsaZ2lLsYKl89TVOJmI MKYo00MQZROoJrp7NmpgqVHg+lpgC8a0+88CzsCXHddi4wMRZinjRoJPSOgyLAmza1Xq eNCI0b6fhtiDYXu6VNdxav8wXVwHPrJ5sL2gC8Bju9R53cSb6CGlMZFKFAxMLfT8eCHV NK+ztxvu7raTa4IkUyd7eAfUfZICUX7G+hDGFsPhC14oQvbu7XIh36MUPl6A9rZhlh3F ObHgxT/uBAHuc8H0skCGpotVCpurfOmf2toWEVeCEyqs+/42JrI0fre7vPVxteZBtlRx QT4w== X-Gm-Message-State: AOAM530H4HSeHNSKYleuoDCCknmT+ZQlnxk1cO8VwomypKQcKYV3q6L5 l5vb9oZ2kv54s2PNCyCgaJoxEq+6EFw= X-Google-Smtp-Source: ABdhPJwH+uj67RxrQ8nYPTfm4uCYla5jDpIPOKPyG1BrAyzsw27Ff0QBezti+WXxwOyBwRCXaWchdQ== X-Received: by 2002:adf:f288:: with SMTP id k8mr6105361wro.350.1629228051220; Tue, 17 Aug 2021 12:20:51 -0700 (PDT) Received: from lili (roam-nat-fw-prg-194-254-61-44.net.univ-paris-diderot.fr. [194.254.61.44]) by smtp.gmail.com with ESMTPSA id e11sm3336106wrm.80.2021.08.17.12.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 12:20:50 -0700 (PDT) From: zimoun In-Reply-To: <87czr9avzc.fsf@gnu.org> References: <20210715073328.212123-1-zimon.toutoune@gmail.com> <20210715073328.212123-2-zimon.toutoune@gmail.com> <877dhpmjda.fsf@systemreboot.net> <87czr9avzc.fsf@gnu.org> Date: Tue, 17 Aug 2021 16:03:17 +0200 Message-ID: <86pmucb23e.fsf@gmail.com> 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629228130; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NIYxTF9U5NbY2OrvQvqDpRT0W1LQEUqBfPBTP80BwtY=; b=SNCtOCi+RJE1xTPNCE+jD/mMw9xsCOu3PfL5DiZW2Ke8I5/RHXuHfuN8Gm7r0WhGP7uEXJ 3465iohInXDPIuv8Zv0X2iPV3Upw5kRsH9uCJ9YMhDDRrEwpGocgFjdMQQlahTQdY7NamC 4CliINyK1LAnB084MOY53ErqOJTHUCxlLKKgyHVCfiJU+zY5XYb9Drjgp4lpbGCv64lMJa I85mOKL9esu8B900V3ZqrmdpLSNbbDbLpH1naSZ0eQJztrGZtzN4Xz16fFynyuMkMux0/S C6PV2oTohvV0vL9hxDFgD84wfig+ZETkm9nTe00I5uGNHBM6gbXBQrf5Zs+vUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629228130; a=rsa-sha256; cv=none; b=iLznBEB+EpsebFlO1PMBdqqC/ysu4takotm2NDC/f3OGxKe4V8XsPT17v4XwZg20dHvGM7 7VMwaECMa33rH2Kw3VQuWuDFY1EOB1hHS+H9cbs5ZNIWp47T/4DBthPqmRexPVItcEIncJ LPRllPk/gpcVBl5hHpdY61dHc5x/Sxgo0qfwS06943Vsg8vJB0jWwNTLsXcYBhq+BVhUrf Knzd8d5omSEsB9ps4341o0k9YaxkGYma0LcHvjD1PQn5csHRExGWAGGxpv41zO7cF1wVfg jaPysubUN3BxXQOcxKTNzEEqUpffirfxgxfnNj6iQQste40oOev5nHcCV2BOKw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=isRdKSWU; 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-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=isRdKSWU; 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: AC317B4A9 X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: Mk45QMMN/8+8 Hi Arun and Ludo, Thanks for the review. On Sat, 17 Jul 2021 at 14:01, Arun Isaac wrote: > I understand that one of the things you are trying to do is to have a > common interface for the cache and no-cache cases. To achieve this, I > think fold-available-packages and fold-packages should have the same > function signature. They should both pass a object to > PROC. Currently, fold-packages is passing a object whereas > fold-available-packages is passing the fields of the object as > individual parameters. If fold-packages and fold-available-packages have > the same function signature, then the changes in your [PATCH v6 2/2] > would be way simpler. I agree. Previously [1], I created =E2=80=99fold-packages*=E2=80=99 which = was a cached =E2=80=99fold-packages=E2=80=99 and Ludo answered [2]: Did you see =E2=80=98fold-available-packages=E2=80=99? It seems yo= u could extend it instead of introducing =E2=80=98fold-packages*=E2=80=99, = no? therefore, it is somehow another attempt on the other side. :-) 1: 2: > Also, why do we need two separate functions---fold-available-packages > and fold-packages? Can't fold-available-packages do everything > fold-packages can and thus totally replace it? To be honest, I have been lazy because unifying =E2=80=99fold-available-packages=E2=80=99 and =E2=80=99fold-packages=E2=80= =99 means to change the signature and so a bit of refactoring. And as Ludo explained, =E2=80=99fold-available-packages=E2=80=99 has to be as light as possible be= cause it is used by Emacs-Guix and maybe Nyxt for completion. :-) >> * gnu/packages.scm (generate-package-cache)[expand-cache]: Add synopsis = and >> description. >> (load-package-cache, find-packages-by-names, find-packages-locations): A= dapt >> accordingly. > > A couple of typos here: > > find-packages-by-names -> find-packages-by-name > find-packages-locations -> find-package-locations Thanks for the spot. On Fri, 23 Jul 2021 at 17:30, Ludovic Court=C3=A8s wrote: > One benchmark is =E2=80=9Cguix package -A > /dev/null=E2=80=9D. This sho= uld take > ideally 0.5s at most because that=E2=80=99s what=E2=80=99s used by shell = completion (the > first time); currently it takes 0.82s on my laptop, though. On cold cache, on my laptop: --8<---------------cut here---------------start------------->8--- $ time guix package -A > /dev/null real 0m1.717s user 0m2.526s sys 0m0.083s --8<---------------cut here---------------end--------------->8--- and on my (slow) desktop: real 0m6.196s user 0m2.008s sys 0m0.093s Warn cache: laptop desktop real 0m1.425s 0m1.217s user 0m2.505s 0m1.901s sys 0m0.033s 0m0.051s Well, another story I guess. :-) Cheers, simon