Re: [PATCH v3 3/9] Makefile: disable GNU make built-in wildcard rules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 25, 2022, 23:17 UTC
- Message-ID
- <xmqqk0di8rk9.fsf@gitster.g>
- In-Reply-To
- <patch-v3-3.9-9392e3c3e97-20220225T090127Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 5 quoted lines
> Override built-in rules of GNU make that use a wildcard target. This > can speeds things up significantly as we don't need to stat() so many > files. GNU make does that by default to see if it can retrieve their > contents from RCS or SCCS. See [1] for an old mailing list discussion > about how to disable these.
;-)
> The speed-up may wary. I've seen 1-10% depending on the speed of the
vary, you mean?
Show 6 quoted lines
> local disk, caches, -jN etc. Running: > > strace -f -c -S calls make -j1 NO_TCLTK=Y > > Shows that we reduce the number of syscalls we make, mostly in "stat" > calls.
Naturally understandable.
I do remember getting surprised after seeing output from "make -d" and how many paths were considered for possible places that a source file can come from.
Show 14 quoted lines
> +### Remove GNU make implicit rules > + > +## This speeds things up since we don't need to look for and stat() a > +## "foo.c,v" every time a rule referring to "foo.c" is in play. See > +## "make -p -f/dev/null | grep ^%::'". > +%:: %,v > +%:: RCS/%,v > +%:: RCS/% > +%:: s.% > +%:: SCCS/s.% > + > ### Flags affecting all rules > > # A GNU make extension since gmake 3.72 (released in late 1994) to