* [gentoo-dev] [leitner@fefe.de: Why make(1) sucks]
@ 2001-06-18 16:17 99% Daniel Robbins
0 siblings, 0 replies; 1+ results
From: Daniel Robbins @ 2001-06-18 16:17 UTC (permalink / raw
To: gentoo-dev
Hi All,
Thought some people may be interested in this email from the dietlibc
mailing list. This is one of the reasons we don't use "make" for our
ports system.
----- Forwarded message from Felix von Leitner <leitner@fefe.de> -----
To: dietlibc@fefe.de
Date: Mon, 18 Jun 2001 22:45:47 +0200
From: Felix von Leitner <leitner@fefe.de>
Subject: Why make(1) sucks
If you compile the diet libc frequently, you probably noticed that
running make takes over one second before even running any command.
If you look at the Makefile, you will notice that it contains a lot of
dynamic features like wildcard and patsubst and a long list of VPATHs.
So I assumed that these were the parts that ate all the time and wrote a
perl script that a) removes the wildcards and patsubsts by expanding
them in-line and b) computing the dependencies statically and stating
them explicitly.
I checked in that script as contrib/static.pl. It will write the new
Makefile to sMakefile. I expected a noticeable performance increase in
make after the first part was done (remove wildcard and patsubst), but
the pause increased to 7.5 seconds on my Athlon 900. Huh?
Well, maybe the VPATHs are the part that takes so long, I thought, so I
added the b) part. The pause decreased to 7.0 seconds. I couldn't
believe it and put the dynamic wildcard and patsubst part back in, and
now make again takes 1 second. Adding a syntax error in the end
revealed that make apparently takes one full second to parse the
Makefile!
Switching to a perl script would increase performance tenfold!
This can't be true, can it?
So I did an strace and found out that every occurrance of $(OBJDIR)
prompted make to recalculate $(ARCH), i.e. run uname and sed!
Now that I see why make sucks, I'm working on a solution. The obvious
solution is to simply run make again setting MYARCH to something. When
I do that with the static dependencies, make takes 0.08 seconds to
notice that it does not have to do anything.
Felix
----- End forwarded message -----
--
Daniel Robbins <drobbins@gentoo.org>
President/CEO http://www.gentoo.org
Gentoo Technologies, Inc.
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2001-06-18 16:17 99% [gentoo-dev] [leitner@fefe.de: Why make(1) sucks] Daniel Robbins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox