On Sunday 09 May 2010 11:28:18 Joey Hess wrote:
> 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.
24 too many, but I agree, "great performance penalty" was too much.
> > 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.
Interesting. It was until now that I actually took a look at what it was doing
behind the scene.
> > -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.)
Yep.
> 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.
Excellent, thanks!
I will see how else debhelper could be made faster.
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]