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

Re: [PATCH v2 1/5] Documentation/Makefile: conditionally include doc.dep

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 7, 2020, 03:18 UTC
Message-ID
<CAMP44s1eb7O+bYXFyYm7BLCP37r1k80XY4MOC8RRL4nY61CMDQ@mail.gmail.com>
In-Reply-To
<a8e1bc9d-ce6c-d065-5a20-fee15967364d@ramsayjones.plus.com>
On Sun, Dec 6, 2020 at 6:35 PM Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
Show 31 quoted lines
>
>
> The 'clean' target is noticeably slow on cygwin, even for a 'do-nothing'
> invocation of 'make clean'. For example, the second 'make clean' below:
>
>   $ make clean >/dev/null 2>&1
>   $ make clean
>   GIT_VERSION = 2.29.0
>   ...
>   make[1]: Entering directory '/home/ramsay/git/Documentation'
>       GEN mergetools-list.made
>       GEN cmd-list.made
>       GEN doc.dep
>   ...
>   $
>
> has been timed at 23.339s, using git v2.29.0, on my laptop (on old core
> i5-4200M @ 2.50GHz, 8GB RAM, 1TB HDD).
>
> Notice that, since the 'doc.dep' file does not exist, make takes the
> time (about 8s) to generate several files in order to create the doc.dep
> include file. (If an 'include' file is missing, but a target for the
> said file is present in the Makefile, make will execute that target
> and, if that file now exists, throw away all its internal data and
> re-read and re-parse the Makefile). Having spent the time to include
> the 'doc.dep' file, the 'clean' target immediately deletes those files.
>
> In order to eliminate such wasted effort, use the value of the internal
> $(MAKECMDGOALS) variable to only '-include doc.dep' when the target is
> not 'clean'. (This drops the time down to 12.364s, on my laptop, giving
> an improvement of 47.02%).

All this makes sense, but I had to do "make doc.dep" and take a look at that file to understand why:

doc.dep contains make rules with targets and dependencies that will not be used in "make clean".

This is in my opinion the important information. Maybe mention something like that in the commit message?

Cheers.
-- 
Felipe Contreras
Previous: Ramsay JonesNext: Ramsay Jones
Message 2 of 5 in “Documentation/Makefile: conditionally include doc.dep”
  1. 1/5 Documentation/Makefile: conditionally include doc.depRamsay Jones, Dec 7, 2020
  2. Felipe ContrerasDec 7, 2020
  3. Ramsay JonesDec 8, 2020
  4. Junio C HamanoDec 7, 2020
  5. Ramsay JonesDec 8, 2020

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.