Raphael Geissert wrote:
> With the introduction of dh(1), many packages now use it, including lintian 
> for its testsuite. However, it comes with a great performance penalty 
> compared 
> to just "using what is needed."

A typical rules file that runs only what is needed will call debhelper
commands 21 to 25 times. dh calls 49. I think you're overstating it
somewhat.

> Version: 7.4.19

> While taking a look at what makes debhelper very slow I noticed it calls dpkg-
> architecture many times per package (66 times for the majority of the 
> packages).

Heh, you really confused me with this, given that 7.4.19 already reduced the
number of calls to dpkg-architecture by sometimes as much as 43x. I
had thought about combining buildarch and buildos, but it seemed minor
in comparison with that.

> -sub dpkg_architecture_value {
> -     my $var = shift;
> -     my $value=`dpkg-architecture -q$var` || error("dpkg-architecture 
> failed");
> -     chomp $value;
> -     return $value;
> +{
> +     my %dpkg_arch_output;
> +     sub dpkg_architecture_value {
...
> +     }
>  }
>  
>  # Returns the build architecture. (Memoized)

Of course, the extra layer of memoization in buildos and buildarch
is then unnecessary. (Fixed in git.)

Still, further improvement is possible. Most of the time, buildarch and
buildos are only used in pkgfile. So, I changed it to glob to find
possible files, and only use buildos/buildarch to narrow the set if
there are multiple possibilities. So now the number of dpkg-architecture
calls has reached 0 for most packages.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to