On Mon, 23 Aug 2021 23:42:14 +0200 Timo Weingärtner wrote:

> The time needrestart takes to analyse processes is to a great amount
> influenced by the existence and count of perl processes:

I just profiled needrestart using NYTProf and found that the
problem is actually caused by the Module::ScanDeps Perl module:

   sudo apt install libdevel-nytprof-perl
   sudo env NYTPROF=trace=2:start=init:file=`pwd`/nytprof.out perl -d:NYTProf 
/usr/sbin/needrestart
   sudo chown "$USER"
   nytprofhtml --open

I found that on my system there are a couple of Perl processes
and one of them takes a lot more time to scan than the other one.

   $ ps auxf | grep perl | grep -oE '/usr/s?bin/[^ ]*' | sort -u
   /usr/bin/parcimonie
   /usr/bin/perl
   /usr/sbin/spamd

   $ time scandeps /usr/sbin/spamd > /dev/null
   
   real 0m1.430s
   user 0m1.350s
   sys  0m0.080s
   
   $ time scandeps /usr/bin/parcimonie > /dev/null
   # Use of runtime loader module Module::Runtime detected.  Results of static 
scanning may be incomplete.
   # Use of runtime loader module Module::Implementation detected.  Results of 
static scanning may be incomplete.
   
   real 0m8.155s
   user 0m7.006s
   sys  0m0.999s
   
Researching the landscape of such tools, I found these other ones:

   Perl::PrereqScanner
   Perl::PrereqScanner::NotQuiteLite
   Perl::PrereqScanner::Lite
   
   
https://stackoverflow.com/questions/358891/how-do-i-find-the-module-dependencies-of-my-perl-script

These all complete a *lot* faster but do not produce the same
results and so they are probably *not* useful for this situation.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to