GNU bug report logs - #50755
[PATCH] import: Generate list of importers based on available modules

Previous Next

Package: guix-patches;

Reported by: pinoaffe <pinoaffe <at> airmail.cc>

Date: Thu, 23 Sep 2021 12:25:02 UTC

Severity: normal

Tags: patch

Full log


Message #35 received at 50755 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: pinoaffe <pinoaffe <at> airmail.cc>
Cc: 50755 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: [bug#50755] [PATCH v3] import: Generate list of importers based
 on available modules
Date: Wed, 29 Sep 2021 22:59:21 +0200
[Message part 1 (text/plain, inline)]
pinoaffe schreef op di 28-09-2021 om 16:39 [+0200]:
> Hi, 
> 
> Maxime Devos writes:
> > To only measure the time required for defiing 'importers', wrap
> > delete-duplicates in a call to 'time' from (ice-9 time).
> 
> Running
> 
> (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)))
> 
> in a guix repl on my system results in
> 
> clock utime stime cutime cstime gctime
>  0.96  1.67  0.07   0.00   0.00   1.19
> 
> 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 module
name.  For a module name, the first 'resolve-module' incurs disk I/O and some
CPU for loading the module, but the second 'resolve-module' on the same module
name would be free, as the module is already loaded.

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.