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 ms0.migadu.com with LMTPS id uBdjBCUnUmHlnwAAgWs5BA (envelope-from ) for ; Mon, 27 Sep 2021 22:18:45 +0200 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 +HiFOyQnUmEHcAAAbx9fmQ (envelope-from ) for ; Mon, 27 Sep 2021 20:18:44 +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 AFE2FD609 for ; Mon, 27 Sep 2021 22:18:44 +0200 (CEST) Received: from localhost ([::1]:33694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUx5H-000505-Sm for larch@yhetil.org; Mon, 27 Sep 2021 16:18:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUwwt-0002Xq-A6 for guix-patches@gnu.org; Mon, 27 Sep 2021 16:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUwwt-0000D2-25 for guix-patches@gnu.org; Mon, 27 Sep 2021 16:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUwws-0003Bq-TD for guix-patches@gnu.org; Mon, 27 Sep 2021 16:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50755] [PATCH v3] import: Generate list of importers based on available modules Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 27 Sep 2021 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50755 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: pinoaffe Cc: 50755@debbugs.gnu.org Received: via spool by 50755-submit@debbugs.gnu.org id=B50755.163277338512201 (code B ref 50755); Mon, 27 Sep 2021 20:10:02 +0000 Received: (at 50755) by debbugs.gnu.org; 27 Sep 2021 20:09:45 +0000 Received: from localhost ([127.0.0.1]:42935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUwwa-0003Aj-Uh for submit@debbugs.gnu.org; Mon, 27 Sep 2021 16:09:45 -0400 Received: from mail-qk1-f173.google.com ([209.85.222.173]:39933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUwwZ-0003AW-05 for 50755@debbugs.gnu.org; Mon, 27 Sep 2021 16:09:43 -0400 Received: by mail-qk1-f173.google.com with SMTP id f130so38200918qke.6 for <50755@debbugs.gnu.org>; Mon, 27 Sep 2021 13:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bse/cK62J4yPWAeuSofq9Gd8Z4QneGI7XX/yta5xvGY=; b=OwDSqua6xy+d1N4Sd8BJrTM3V224wsw8mwmjurkEoJpz/5v3y5RViY8+B8UL/xpxHx uqLTJwEyVS7c0hjCDb2FF+YC68LLd6VWR4esnE3dRU9/pm/2cNVSHtlZTgE1ko0ahdWE ddU6tiE3oN6zliFBKgmK5NAGbaCgpqWIJr4GvMGIIJqKCi9OPdJWghYfokPUens7VvRw qQggl4A+9ltvOeZagO0F64U2HVtXjymAwWK+SPEAZ0hoBZ7++ENyuo27VnltZ+lYMgB4 tePY49OHlxlDSzvagoDlymvLad0sqOt+YxSlZrbeuKoBvjFFGADLc0K9sMLJs1JCu4tI gNBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bse/cK62J4yPWAeuSofq9Gd8Z4QneGI7XX/yta5xvGY=; b=GfwwHbDLbfzf0CTCnF15b4n7c7Qeas2E+Zj1Dh+/w50zkRZbsQwyffTMXZpkI8/bIf ZQKHw4dtJOfYpNZXr5kydEYw8TqS6P4OCrcmAtthnvAKIOSX5yAMLYqwpW4XQRWYEqpJ nlWrGGzW4bIT+E2pw7zpOS6QLtdfc+9mavcGS5frBRFm9f2azf1nxrcQsL+j9PacNaDA KY67ajTyc1YDYBzTCyKe3RtLE9AD1QT09mxzgFuDnjyKzAmlKciwNpy/C/vNf1VDuelt 0rBfjrOcZjLcStYOH2t9ce03ntfDJMHJ/vOYVFRGyXXdD3ccgW1njvcC65Y6Qupn2NNy 0UKw== X-Gm-Message-State: AOAM531zSNlBbWFiEXJCMCAs/AWrt+tJ7pSTvzUxlZIMmutYR6kd6fr7 eIm8g50iypZmXgHqJKqTphv5lSxUK8yQEs+BnVizVWjEaBZA3Q== X-Google-Smtp-Source: ABdhPJyn0oucoRMro339nf97QOamZv/03xYhLE5G5vnrfPLja2N5BJRHY2D5AhEYx3GnA51f3WeMt9H4Fbajy2xLWjg= X-Received: by 2002:a37:2d04:: with SMTP id t4mr1760520qkh.463.1632773377138; Mon, 27 Sep 2021 13:09:37 -0700 (PDT) MIME-Version: 1.0 References: <87tuibh43w.fsf@airmail.cc> <87mtnxswwq.fsf@airmail.cc> In-Reply-To: <87mtnxswwq.fsf@airmail.cc> From: zimoun Date: Mon, 27 Sep 2021 22:09:26 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" 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=1632773924; 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: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=bse/cK62J4yPWAeuSofq9Gd8Z4QneGI7XX/yta5xvGY=; b=cSrW5r8YKuAhh2X6Yjm/Ml4Ei5UDZGXNalEIWlMyZvuHh08xT5GIboiBlUfInfJGIlqtKm gfmH1TogPZkPasUQHPgA5aoZSUcp/55YDKI054v6M7m/aUaemyoIMghn4Bm4QKwyJFo/83 JzXqC5qgc/l9dUgtFZmafAccqMPxJYijG1uo6P9GjwzY/Z8qqYyITDD6O2PXYxobkxd/iq Hch1nIwheLiSFuLadq8xpsOeH/ncnKp79ueDW1AqFsbNq12zAM5mXhHnowzds3Ce5CcVt4 1Mj02CRQcOO7DowEQa1BSuOE6ibofQmvT8d7zi0nfW5NaKekmw6afrQFaaneXw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632773924; a=rsa-sha256; cv=none; b=ey5RziRI/7wQYFQCsd1Q+346YeWUGaI5cww38QO+7fIgNLzASia5FVggEMkchGSjQyyES3 i7UP3A0XaYW9DJWwAsODNs5v5R7BXh5qavWs6Kei9NhK9Haku+pgkVigb2eCmWMaE4x7sF jPfUoSy/OUnLhfPIretrfTiMdVARdKQwsxaXtdYknq0xjfyK+PXAmNicsIErUPnJMUlvK1 mwSga+sZXBkmLBtM5WEnU+CR/BqCXVMIQRVg/I/iEFgNJ51nLvxqndiIcoWl2+S9/OEWEA n2HZSAw7a5dctlGHR4FCLXq8aaQ9/rqloQTnN8oRmfu6FZ13cWb/s1dZhnwx0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=OwDSqua6; 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.69 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=OwDSqua6; 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: AFE2FD609 X-Spam-Score: -1.69 X-Migadu-Scanner: scn1.migadu.com X-TUID: d7DFCLs7rzv4 Hi, On Mon, 27 Sept 2021 at 20:21, pinoaffe wrote: > +(define importers (delete-duplicates This fixes my first point... > + (filter-map (lambda (module) > + (match (module-name module) > + (`(guix scripts import ,importer) > + (symbol->string importer)) > + ( #t #f))) > + (all-modules (map (lambda (entry) > + `(,entry . "guix/scripts/import")) > + %load-path))))) ...and it means it is walking more than needed. Therefore, what is the performance loss? For instance, on my machine and hot cache, it is 4x slower. And, this readibility improvement is not worth, IMHO. On cold cache, I do not have meaningful numbers because it requires to run it several times and then compute an average. What are the numbers of your machine? All the best, simon