Re: Faster depend written in Perl

Daniel Quinlan (
26 Jul 1996 12:23:10 -0400

Ian Burrell <> writes:

> I have an old 386/33 and running 'make depend' takes a long time.

Upgrade! 486 motherboards with CPU are so cheap that there is no

> I heard this was because gawk uses floating point instead of integer
> arithmetic. To speed things up, I translated the depend.awk script
> into Perl using the a2p program. I edited the result to clean up
> the code. The resulting script runs much faster (up to an order of
> magnitude on my machine without a coprocessor) either because of
> integer arithmetic or Perl's faster I/O.

It runs 25% faster on my P-90 (it's mostly I/O bound), but I'm not
complaining. It might be possible to tweak the translation a bit

You might try also mawk instead of gawk. gawk is slow. Running the
script with mawk was 36% faster than gawk.

Defaulting to the perl version is probably better since most people
don't have mawk.


Daniel Quinlan          Member of the League for Programming Freedom