Re: Perl make depend made faster

Luca Lizzeri (lizzeri@mbox.vol.it)
Sat, 14 Sep 1996 18:51:13 +0200 (MET DST)


On Sat, 14 Sep 1996, Edward Welbon wrote:

> I ran this on my p6 box (dog slow ide) and got these results:
>
> with perl 5.003: 11.47user 10.73system 0:25.47elapsed 87%CPU
> original: 23.17user 8.81system 0:53.77elapsed 59%CPU
>

Thanks. This is Some Gain :) I hope it can get included in the kernel.
I will make it available on the patches archive, if anyone reminds me
where it is ( private mail, please ).

I shaved 5 more seconds, and changing the hpdepend rule can save
some more. If interest warrants it I'll release the new version.

I Would like to know why the system time is consistently 20 % higher in
perl than in awk. Maybe it's because doing line-by-line reads (even if
buffered) the system time gets misattributed.

> I ran the build twice in each case and saw no significant change from
> run to run BTW.
>

To check if it works properly you can do this:

make dep # with awk
find -name .depend -o -name .hdepend | xargs cat > awk-dep
make dep # with perl
find -name .depend -o -name .hdepend | xargs cat > perl-dep
diff -u awk-dep perl-dep

> I got the "new" error messages also, is it necessary to correct these?
>
> > Here are a couple of warnings that on gawk under make don't make it to
> > stderr ( on both my systems ):
> >
> > ide_modes.h needs config but has not included config file
> > g_NCR5380.h needs config but has not included config file
> > dev_table.h needs config but has not included config file

Correcting them seems trivial. Put #include <linux/config.h> in these
files, the warning will go away. I don't know if it is necessary, so I
didn't correct anything.

A more dangerous matter is the fact that both depend.awk and depend.pl
don't check for unbalanced comment delimiters in double quoted strings.
They do happen ( drivers/sound/{configure.c,hex2hex.h},
arch/ppc/kernel/mk_defs.c ). In some other files there are complete
comments in some double quoted strings ( some m68k specific files ).

The unbalanced delimiters could obviously make the dep output be
unreliable for the files in question. Fortunately the 2 files in question
regard only the sound configuration process.

Should the depend script check for this ?

Luca Lizzeri