--- v3
+++ v4
@@ -1,39 +1,14 @@
As noted in v2[1] this series fixes various dependency issues in the
-Makfile.
+Makfile. See [2] for before/after benchmark numbers.
-New in v3 is a fix for the dependency issue Mike Hommey reported[2]
-with hook-list.h, and 3x new and big optimizations that I'd planned to
-submit later on-top, but I figured would be better to consider as part
-of these general dependency improvements.
+This v4 addresses small issues Mike Hommey noted, and clarifies
+various questions that came up with updated commit messages.
-With those new changes on top we run ~1.4x faster on no-op runs (under
-NO_TCLTK=Y, since that would otherwise eat most of our runtime either
-way):
-
- $ git hyperfine -L rev origin/next,HEAD~0 -s 'make -j8 all NO_TCLTK=Y' 'make NO_TCLTK=Y' --warmup 10 -r 10
- Benchmark 1: make NO_TCLTK=Y' in 'origin/next
- Time (mean ± σ): 187.4 ms ± 2.4 ms [User: 146.5 ms, System: 57.1 ms]
- Range (min … max): 184.7 ms … 192.8 ms 10 runs
-
- Benchmark 2: make NO_TCLTK=Y' in 'HEAD~0
- Time (mean ± σ): 136.1 ms ± 0.9 ms [User: 103.0 ms, System: 47.6 ms]
- Range (min … max): 135.4 ms … 138.2 ms 10 runs
-
- Summary
- 'make NO_TCLTK=Y' in 'HEAD~0' ran
- 1.38 ± 0.02 times faster than 'make NO_TCLTK=Y' in 'origin/next'
+There's also a fix-for-the-fix here in removing the "hook.c"
+dependency on hook-list.h in 19/23.
-Which, as noted before is working nicely towards making executing
-"make" in a loop faster, such as under "git rebase --exec".
-
-Those optimizations are a mixture of clever and "dumb but
-works". E.g. around 10% of the runtime was spent by the Makefile
-looking for git's sources in the RCS and SCCS source control
-management systems, before giving up and considering the relevant file
-on disk.
-
-1. https://lore.kernel.org/git/cover-v2-00.18-00000000000-20211112T214150Z-avarab@gmail.com
-2. https://lore.kernel.org/git/20211115230032.3or3qqlsdnxjtrol@glandium.org/
+1. https://lore.kernel.org/git/cover-v2-00.18-00000000000-20211112T214150Z-avarab@gmail.com/
+2. https://lore.kernel.org/git/cover-v3-00.23-00000000000-20211116T114334Z-avarab@gmail.com/
Ævar Arnfjörð Bjarmason (23):
Makefile: don't invoke msgfmt with --statistics
@@ -62,7 +37,7 @@
.gitignore | 2 +-
Documentation/Makefile | 71 +---------
- Makefile | 313 +++++++++++++++--------------------------
+ Makefile | 314 +++++++++++++++--------------------------
config.mak.uname | 1 -
git-cvsserver.perl | 6 +-
git-send-email.perl | 7 +-
@@ -70,33 +45,113 @@
shared.mak | 187 ++++++++++++++++++++++++
t/Makefile | 34 ++---
templates/Makefile | 19 +--
- 10 files changed, 337 insertions(+), 305 deletions(-)
+ 10 files changed, 337 insertions(+), 306 deletions(-)
create mode 100644 shared.mak
-Range-diff against v2:
- 1: 75ebf7b04e5 = 1: 1621ca72c1d Makefile: don't invoke msgfmt with --statistics
- 2: 138f60ba37b = 2: b7c36c9fea0 Makefile: don't set up "perl/build" rules under NO_PERL=Y
- 3: 472e1eb74bd = 3: 510499d18ba Makefile: use "=" not ":=" for po/* and perl/*
- 4: a5ce2dce164 = 4: 37f3591bcca Makefile: clean perl/build/ even with NO_PERL=Y
- 5: 04dbc1d2809 = 5: e38c90ad0b6 Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR
- 6: eea89794493 = 6: 98e14c7eba9 Makefile: guard Perl-only variable assignments
- 7: e06732d4639 = 7: 047a42b01cf Makefile: change "ifndef NO_PERL" to "ifdef NO_PERL"
- 8: a9502a23989 = 8: 0c0a3de390e Makefile: adjust Perl-related comments & whitespace
- 9: c1336fc0a56 = 9: 1ece3160915 Makefile: correct "GIT-PERL-{DEFINES,HEADER}" dependency graph
-10: 41f65a12205 = 10: e9b61cd0ba5 Makefile: create a GIT-PYTHON-DEFINES, like "PERL"
-11: bfa15059d60 = 11: b020f8e3257 Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts
-12: 656d02ab641 = 12: 19539ce7d2d Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it
-13: 6e25ac71cbc = 13: 6c9291c2c9f Makefile: move $(comma), $(empty) and $(space) to shared.mak
-14: 64296e6e8e5 = 14: e811a907b08 Makefile: re-add and use the "shellquote" macros
-15: 5654d7f7f29 = 15: fac30fe8b56 Makefile: add a "TRACK_template" for GIT-*{FLAGS,DEFINES,...}
-16: 0a348b54491 = 16: a3e3acea82d Makefile: add "$(QUIET)" boilerplate to shared.mak
-17: 34f692144d1 = 17: 22264f431c8 Makefile: use $(wspfx) for $(QUIET...) in shared.mak
-18: 5b3986bc4a8 = 18: d61e2b44f68 Makefiles: add and use wildcard "mkdir -p" template
- -: ----------- > 19: 234b4eb613c Makefile: correct the dependency graph of hook-list.h
- -: ----------- > 20: 567ad5c3ebc Makefile: use $(file) I/O instead of "FORCE" when possible
- -: ----------- > 21: cb3ae5ce00b Makefile: disable GNU make built-in wildcard rules
- -: ----------- > 22: 88cfc946b37 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)
- -: ----------- > 23: 276e226f0a8 Makefile: move ".SUFFIXES" rule to shared.mak
+Range-diff against v3:
+ 1: 1621ca72c1d = 1: 1621ca72c1d Makefile: don't invoke msgfmt with --statistics
+ 2: b7c36c9fea0 = 2: b7c36c9fea0 Makefile: don't set up "perl/build" rules under NO_PERL=Y
+ 3: 510499d18ba ! 3: 29b000eb0f1 Makefile: use "=" not ":=" for po/* and perl/*
+ @@ Commit message
+ think I copied some POC code), and in 2017 I used the 2011 commit for
+ reference.
+
+ + This doesn't make much if any of a practical difference, doing this is
+ + cheap either way, but as simply-expanded variables in our Makefile
+ + generally indicate special behavior (e.g. making a copy now, and
+ + modifying the RHS later) let's change these to show that nothing odd
+ + is going on here).
+ +
+ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+
+ ## Makefile ##
+ 4: 37f3591bcca = 4: daead5ec293 Makefile: clean perl/build/ even with NO_PERL=Y
+ 5: e38c90ad0b6 ! 5: 3c987590740 Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR
+ @@ Commit message
+ file that'll be used as a dependency for other files, as in this case
+ for GIT-PERL-HEADER.
+
+ + We have had a hard dependency on .DELETE_ON_ERROR since
+ + 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR" flag,
+ + 2021-06-29), so this is a pure cleanup as a follow-up to that
+ + commit. Support for the ".DELETE_ON_ERROR" target itself is much older
+ + than any GNU make version we support, it was added to GNU make in
+ + 1994.
+ +
+ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+
+ ## Makefile ##
+ 6: 98e14c7eba9 = 6: b57f582ccd3 Makefile: guard Perl-only variable assignments
+ 7: 047a42b01cf = 7: fcdee92f64c Makefile: change "ifndef NO_PERL" to "ifdef NO_PERL"
+ 8: 0c0a3de390e = 8: 1e25b532ca2 Makefile: adjust Perl-related comments & whitespace
+ 9: 1ece3160915 = 9: 77d9855bfcf Makefile: correct "GIT-PERL-{DEFINES,HEADER}" dependency graph
+10: e9b61cd0ba5 = 10: 6004cdcd8d9 Makefile: create a GIT-PYTHON-DEFINES, like "PERL"
+11: b020f8e3257 = 11: 17b30e96057 Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts
+12: 19539ce7d2d = 12: 30ddf7da2c8 Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it
+13: 6c9291c2c9f = 13: f378a7dc35e Makefile: move $(comma), $(empty) and $(space) to shared.mak
+14: e811a907b08 = 14: 13cbb851d32 Makefile: re-add and use the "shellquote" macros
+15: fac30fe8b56 ! 15: 337953e4994 Makefile: add a "TRACK_template" for GIT-*{FLAGS,DEFINES,...}
+ @@ shared.mak: shelldquote = '"$(call shdq,$(call shq,$(1)))"'
+ +$(1): FORCE
+ + @FLAGS='$$($(2))'; \
+ + if ! test -f $(1) ; then \
+ -+ echo $(wspfx_sq) "$(1) PARAMETERS (new)" $@; \
+ ++ echo $(wspfx_sq) "$(1) PARAMETERS (new)"; \
+ + echo "$$$$FLAGS" >$(1); \
+ + elif test x"$$$$FLAGS" != x"`cat $(1) 2>/dev/null`" ; then \
+ -+ echo $(wspfx_sq) "$(1) PARAMETERS (changed)" $@; \
+ ++ echo $(wspfx_sq) "$(1) PARAMETERS (changed)"; \
+ + echo "$$$$FLAGS" >$(1); \
+ + fi
+ +endef
+16: a3e3acea82d = 16: 5bb597c1993 Makefile: add "$(QUIET)" boilerplate to shared.mak
+17: 22264f431c8 = 17: 3c4d0589667 Makefile: use $(wspfx) for $(QUIET...) in shared.mak
+18: d61e2b44f68 = 18: be5882b2c99 Makefiles: add and use wildcard "mkdir -p" template
+19: 234b4eb613c ! 19: 2710f8af6cd Makefile: correct the dependency graph of hook-list.h
+ @@ Commit message
+ inadvertently made to depend on hook-list.h, but it's used by
+ builtin/bugreport.c.
+
+ + The hook.c also does not depend on hook-list.h. It did in an earlier
+ + version of the greater series cfe853e66be was extracted from, but not
+ + anymore. We might end up needing that line again, but let's remove it
+ + for now.
+ +
+ Reported-by: Mike Hommey <mh@glandium.org>
+ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+
+ ## Makefile ##
+ @@ Makefile: git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
+ + $(filter %.o,$^) $(LIBS)
+
+ help.sp help.s help.o: command-list.h
+ - hook.sp hook.s hook.o: hook-list.h
+ +-hook.sp hook.s hook.o: hook-list.h
+ +builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h
+
+ -builtin/help.sp builtin/help.s builtin/help.o: config-list.h hook-list.h GIT-PREFIX
+20: 567ad5c3ebc = 20: 59f22a0269a Makefile: use $(file) I/O instead of "FORCE" when possible
+21: cb3ae5ce00b ! 21: dd569a59c74 Makefile: disable GNU make built-in wildcard rules
+ @@ Commit message
+ benchmark command shows (under --show-output) that we went from ~7716
+ syscalls to ~7519, mostly a reduction in [l]stat().
+
+ + We could also invoke make with "-r" by setting "MAKEFLAGS = -r" early,
+ + adding a "-r" variant to the above benchmark shows that it may be 1.01
+ + or so faster (but in my tests, always with a much bigger error
+ + bar). 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>
+22: 88cfc946b37 = 22: 4168a7e3b30 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)
+23: 276e226f0a8 = 23: 48a3927d972 Makefile: move ".SUFFIXES" rule to shared.mak
--
-2.34.0.795.g1e9501ab396
+2.34.0.796.g2c87ed6146a