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 ms0.migadu.com with LMTPS id ICWFJtvTVGFbegEAgWs5BA (envelope-from ) for ; Wed, 29 Sep 2021 23:00:11 +0200 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 OFAtItvTVGEYCQAAB5/wlQ (envelope-from ) for ; Wed, 29 Sep 2021 21:00: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 01D1633D4C for ; Wed, 29 Sep 2021 23:00:11 +0200 (CEST) Received: from localhost ([::1]:37884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVggU-0004bE-4S for larch@yhetil.org; Wed, 29 Sep 2021 17:00:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVggN-0004az-35 for guix-patches@gnu.org; Wed, 29 Sep 2021 17:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVggM-0001Wg-Oc for guix-patches@gnu.org; Wed, 29 Sep 2021 17:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVggM-0006zT-Jy for guix-patches@gnu.org; Wed, 29 Sep 2021 17:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50755] [PATCH v3] import: Generate list of importers based on available modules Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 21:00: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, zimoun Received: via spool by 50755-submit@debbugs.gnu.org id=B50755.163294917626807 (code B ref 50755); Wed, 29 Sep 2021 21:00:02 +0000 Received: (at 50755) by debbugs.gnu.org; 29 Sep 2021 20:59:36 +0000 Received: from localhost ([127.0.0.1]:50451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVgfw-0006yJ-G2 for submit@debbugs.gnu.org; Wed, 29 Sep 2021 16:59:36 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:51352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVgft-0006y7-6o for 50755@debbugs.gnu.org; Wed, 29 Sep 2021 16:59:35 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id zwzS250040mfAB401wzSKJ; Wed, 29 Sep 2021 22:59:31 +0200 Message-ID: From: Maxime Devos Date: Wed, 29 Sep 2021 22:59:21 +0200 In-Reply-To: <87k0j0hii3.fsf@airmail.cc> References: <87tuibh43w.fsf@airmail.cc> <87mtnxswwq.fsf@airmail.cc> <4ddbb2adfa86c9ed2e1cf01ad5c1d0129553cbae.camel@telenet.be> <87k0j0hii3.fsf@airmail.cc> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-V7U/ty75n8eYfBC7LX0S" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1632949171; bh=tXWs9naQjArwmEl7tt3aizlmBgFL+QRgAayun4QRHv0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NddOFcLfVSckjSs4bh/IWDMUTb5oKs1lOREDQ1hcWCmdtgAs2siDz/z49wpEPAULa t5e0iCIeRnKNW4yQjtltQtGBZl4RPlNW6BZOlwPPU84al1EZv4n6GMy/RwlKJ2gacm X0MrU3i7eWLgp4zmb5zkxyKDv6akMyqlZ5xrCnycufq7tTG0CfO73OZtb1qWEyiCU4 7CXWsG+RXkJKpwa43Y7yIDeulvOgCJvGALY+TwxA/9+9j4iRKXop7vGl5aU30RAcp2 5dNW/Jb4k2q2jDSIcrdwNJ21W6/bSy70vTW+xFAA0LiKVxi7MuzeLzjHWHsIRyHX/x 8p5sGdo9H3JdQ== 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=1632949211; 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=tXWs9naQjArwmEl7tt3aizlmBgFL+QRgAayun4QRHv0=; b=HQ8JtiaBis3m1guzQF6BGwP8Ny2hb/4FUDyo7v/JfqQvjEiTRO1wFiPHFPCoGUClnSERXm HJ3WP57DnoORuUgmQ+kjHq+zu5Z3+0AZRT5hkGzeFScek9y6UhHbPJMsTqBEXo+tiV97mm TqNM+IEbySvCl4lzchpZorgrlk8LC90g4I53ktYEKJ+3GN8pZR5CXdCoa9kb6TWiQ4uU3M UHLIEICTwoyZwxv6t4vtfm1MpKrOTCv5a18G26LwzZbsvpicZVoOJ7uXMldpNHmIiLlxVf bAJ7sWI9gJJHPXZgrS//ABxXh1ZasBo5g5+52bP3M0QYzxKSOFt2HMvClQ5OYw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632949211; a=rsa-sha256; cv=none; b=gaBe5+v5EEEq/9CHxJ3xNZVNsRKGn8+fERXag7vNWRBaeyg8X5EMZA2IoXeqOpfgFSvItv c1pYeTsGQMOK3Tqw44/QnXZeZqFe1zpGn/e51reSZs9iuTZN68ETt4ZGU5xJXqNf/xB9Kp 5VOCcbNAEALVUIk1i2m4q9uPSfEPI2IvJ0Y7t9EVz82FIg0OO6lR1mXedjuqNXgKz8Nc2V Wf1gq35WP1KfDFzcESTJEQy+nybf7zeq4vLv4heXYU3Mo9ioPakfFM5SujJKRlm2kh9D4V nwMni9QEshRxPcVmogh+b6luLp52dj6q2+N+1QAlbFlmso7rsXlb8pPtuBHYEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=NddOFcLf; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: -3.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=NddOFcLf; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 01D1633D4C X-Spam-Score: -3.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: nCcUv1VMmzCs --=-V7U/ty75n8eYfBC7LX0S Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pinoaffe schreef op di 28-09-2021 om 16:39 [+0200]: > Hi,=20 >=20 > Maxime Devos writes: > > To only measure the time required for defiing 'importers', wrap > > delete-duplicates in a call to 'time' from (ice-9 time). >=20 > Running >=20 > (time (for-each (lambda (_) > (delete-duplicates (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))))) > (iota 1000))) >=20 > in a guix repl on my system results in >=20 > clock utime stime cutime cstime gctime > 0.96 1.67 0.07 0.00 0.00 1.19 >=20 > If I'm interpreting that correctly that would amount to a couple of > thousands of a second per run These numbers turn out to be misleading, because 'scheme-modules' (indirectly called from all-modules) calls 'resolve-interface' on every mod= ule name. For a module name, the first 'resolve-module' incurs disk I/O and so= me CPU for loading the module, but the second 'resolve-module' on the same mod= ule name would be free, as the module is already loaded. Greetings, Maxime --=-V7U/ty75n8eYfBC7LX0S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVTTqRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nSqAP4h8hgA68UTCqb6JLWNAufWq4Pp LFlippHoE3+paowHaQEA48/yt3XWfE6GctcFSRRfvbgJoawuHzaw0zuoG60TFwg= =t0wq -----END PGP SIGNATURE----- --=-V7U/ty75n8eYfBC7LX0S--