git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] doc build: speed up "make lint-docs"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 15, 2021, 12:39 UTC
Message-ID
<patch-3.4-a02a668ebb3-20211015T123619Z-avarab@gmail.com>
In-Reply-To
<cover-0.4-00000000000-20211015T123619Z-avarab@gmail.com>

Extend the trick we use to speed up the "clean" target to also extend to the "lint-docs" target. See 54df87555b1 (Documentation/Makefile: conditionally include doc.dep, 2020-12-08) for the "clean" implementation.

The "doc-lint" target only depends on *.txt files, so we don't need to generate GIT-VERSION-FILE etc. if that's all we're doing. This makes the "make lint-docs" target more than 2x as fast:

$ git show HEAD~:Documentation/Makefile >Makefile.old
$ hyperfine -L f ",.old" 'make -f Makefile{f} lint-docs'
Benchmark #1: make -f Makefile lint-docs
  Time (mean ± σ):     100.2 ms ±   1.3 ms    [User: 93.7 ms, System: 6.7 ms]
  Range (min … max):    98.4 ms … 103.1 ms    29 runs
Benchmark #2: make -f Makefile.old lint-docs
  Time (mean ± σ):     220.0 ms ±  20.0 ms    [User: 206.0 ms, System: 18.0 ms]
  Range (min … max):   206.6 ms … 267.5 ms    11 runs
Summary
  'make -f Makefile lint-docs' ran
    2.19 ± 0.20 times faster than 'make -f Makefile.old lint-docs'
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Documentation/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 78324934d9f..e8e54e053a6 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -284,7 +284,7 @@ install-html: html
 ../GIT-VERSION-FILE: FORCE
 	$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
 
-ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(filter-out lint-docs clean,$(MAKECMDGOALS)),)
 -include ../GIT-VERSION-FILE
 endif
 
-- 
2.33.1.1338.g20da966911a
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 7 of 8 in “doc lint: fix recent regression, make non-.PHONY”
  1. 0/4 doc lint: fix recent regression, make non-.PHONYÆvar Arnfjörð Bjarmason, Oct 15, 2021
  2. 1/4 doc lint: fix error-hiding regressionÆvar Arnfjörð Bjarmason, Oct 15, 2021
  3. 2/4 doc lint: emit errors on STDERRÆvar Arnfjörð Bjarmason, Oct 15, 2021
  4. 4/4 doc lint: make "lint-docs" non-.PHONYÆvar Arnfjörð Bjarmason, Oct 15, 2021
  5. Bagas SanjayaOct 16, 2021
  6. Ævar Arnfjörð BjarmasonOct 16, 2021
  7. 3/4 doc build: speed up "make lint-docs"Ævar Arnfjörð Bjarmason, Oct 15, 2021
  8. Junio C HamanoOct 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.