help-make
[Top][All Lists]
Advanced

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

Re: Performance


From: Jens Schweikhardt
Subject: Re: Performance
Date: Thu, 12 Jul 2001 13:49:40 +0200
User-agent: Mutt/1.2.5i

On Thu, Jul 12, 2001 at 10:15:47AM +0000, Krzysztof Horecki wrote:
# 
# Hi All
# 
# I implemented auto-dependencies after reading Paul's article, but as
# number of .d files generated grows, performance drops. So I try to find
# out where can I win those msecs. After make -d:
# 
# ...
# Reading makefile `../db/db.mk' (search path) (no ~ expansion)...
# Got a SIGCHLD; 1 unreaped children.
# Got a SIGCHLD; 1 unreaped children.
# Got a SIGCHLD; 1 unreaped children.
# Got a SIGCHLD; 1 unreaped children.
# Got a SIGCHLD; 1 unreaped children.
# Got a SIGCHLD; 1 unreaped children.
# Got a SIGCHLD; 1 unreaped children.
# ...
# 
# What do all these SIGCHLDs mean?

That a shell finished execution of a command. You'll see one of these
for every command.

# ~ expansion?
 
Replacing ~ with a username, I think.

# Are there any thumb-rules regarding make performance?

Try to cut down the list of implicit rules. This is what I have at the
top of every GNUmakefile:

# We clear the suffix list completely because we want our own rules
# to always be used. This prevents defaulting to gmake's implicit rules
# in case we forgot to define one ourselves. It has the additional benefit
# of speeding up make's decisions because it will not look for e.g. FORTRAN
# files to build an object.
.SUFFIXES:
# Also remove the implict match-anything rules. They are just a waste of
# time. Try gmake -d to see the difference!
% :: %,v
% :: RCS/%,v
% :: RCS/%
% :: s.%
% :: SCCS/s.%

I've combined Miller's non-recursive make with advanced autogeneration
of dependencies. Even for large projects with several hundred files in
hundred directories, gmake takes less than half a second to figure out
there's nothing to do if everything is up to date (medium sized sparc
with Solaris). If your build process is recursive, you won't gain
anything by microoptimizing your GNUmakefiles because most time is spent
forking and execing instead of walking in-core dependency graphs.


Regards,

        Jens
-- 
Jens Schweikhardt  http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)



reply via email to

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