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

Re: [RFC PATCH 0/8] speed up 'make clean'

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Nov 6, 2020, 01:26 UTC
Message-ID
<f107d6be-0924-88b0-bd34-582b1eed172b@ramsayjones.plus.com>
In-Reply-To
<xmqq361niifm.fsf@gitster.c.googlers.com>
On 05/11/2020 21:48, Junio C Hamano wrote:
Show 14 quoted lines
> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
> 
>> [Yes, 'cd Documentation; make clean all' will be slower that a doing
>> separate 'make clean; make', but the extra 10s, or so, will be swamped
>> by the documentation build time! ;-) ]
> 
> Hmph, the "all" part in "make clean all" needs the information we
> read from these generated files, and time must be spent to generate
> them whether "make clean all" or "make clean; make all" is used.  In
> the latter, we may not generate and read them in the first phase,
> but the second one "make all" would need to do so anyway.  So I am
> puzzled why "make clean all" needs to be slower---don't we generate
> and read them only once in either case?
> 

Hmm, interesting. I was all ready to explain the results of the moc-up of this that I did about a month ago, but thought I should just check again ... ;-)

This time I used the actual Makefile, rather than a moc-up, and got different (in some sense, worse) results. What I was going to say was, no the doc.dep file gets generated twice - but that is not true. :(

However, if you run 'make clean all', you will not be pleased with the results!

  $ make clean
  ...
  $ make clean all >zzz 2>&1
  $ grep WARNING zzz | wc -l
  26
  $ tail -1 zzz
  make: *** [Makefile:362: git.1] Error 13
  $ 

If you look at the output, you will see that, while processing the 'clean' target, the 'doc.dep' file is created, -included, and then immediately deleted. While processing the 'all' target I had expected the 'doc.dep' file to be recreated - but it isn't. It seems to have done the 'drop the internal data, re-read and re-parse' only the once, and on the second go round (because it has already generated it once) does not re-create and re-read the dependency data again. Thus, the 'all' target is executed without any 'doc.dep' data and falls over in a heap. :(

[BTW, just doing 'make' does not do a full build. I will look at why that is later].

Doing 'make clean; make all' works fine, of course.
That will teach me to cut corners! Ho-Hum. Sorry about that.
Thanks.

ATB, Ramsay Jones

Previous: Junio C Hamano
Message 3 of 3 in “speed up 'make clean'”
  1. 0/8 speed up 'make clean'Ramsay Jones, Nov 5, 2020
  2. Junio C HamanoNov 5, 2020
  3. Ramsay JonesNov 6, 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.