diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-03 17:04:14 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-03 14:14:55 -0800 |
commit | dafc2deade1a43100e6129755787a91569b82903 (patch) | |
tree | d4075a88aee47156363b413af3d3e6efe09da44f /notes-cache.h | |
parent | Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it (diff) | |
download | tgif-dafc2deade1a43100e6129755787a91569b82903.tar.xz |
Makefile: disable GNU make built-in wildcard rules
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 vary. I've seen 1-10% depending on the speed of the
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.
We could also invoke make with "-r" by setting "MAKEFLAGS = -r"
early. Doing so might make us a bit faster still. But doing so is a
much bigger hammer, since it will disable all built-in rules,
some (all?) of which can be seen with:
make -f/dev/null -p | grep -v -e ^# -e ^$
We may have something that relies on them, so let's go for the more
isolated optimization here that gives us most or all of the wins.
1. https://lists.gnu.org/archive/html/help-make/2002-11/msg00063.html
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes-cache.h')
0 files changed, 0 insertions, 0 deletions