[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to speed up 'automake'

From: Nick Bowler
Subject: Re: How to speed up 'automake'
Date: Tue, 3 May 2022 17:43:40 -0400

On 2022-05-02, Karl Berry <> wrote:
>     - @echo '# dummy' >$@-t && $(am__mv) $@-t $@
>     + @: >>$@
> 1) does it actually speed anything up?

The answer seems to be a resounding "yes".  I tried one of my packages
on an old slow PC, and changing this one line in cuts almost
5 seconds off of the depfiles generation step in config.status.

(All .deps directories manually deleted between runs as otherwise the
rule commands will not be executed).

  Before (x5):
  % time config.status Makefile depfiles
  real  0m15.320s
  real  0m15.210s
  real  0m15.210s
  real  0m15.210s
  real  0m15.220s

  After (x5):
  % time config.status Makefile depfiles
  real  0m10.650s
  real  0m10.550s
  real  0m10.550s
  real  0m10.550s
  real  0m10.650s

That 5 seconds is a relatively small part of total configure runtime but
it is noticeable.

So if make implementations have no problem including empty files (I tried
a few and all seem OK with it) then it seems like a win.

> 2) without the mv I fear we are no longer noticing write failure

I think it's OK.  All shells that I know of set a failure status when
redirection fails, at least for simple commands like that.

One possible gotcha is that redirections on the : command are not always
reliably performed by older shells.

There might not be any real world problem because configure sets SHELL
in the Makefile to one that probably does not exhibit any problem.  If
it matters, performing the redirection with "exec" instead of ":" should
work in every shell and have pretty much identical performance.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]