forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Accelerate startup time of make
#2110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In d85b0df (Makefile: use `find` to determine static header dependencies, 2014-08-25), we switched from a static list of header files to a dynamically-generated one, asking `find` to enumerate them. Back in those days, we did not use `$(LIB_H)` by default, and many a `make` implementation seems smart enough not to run that `find` command in that case, so it was deemed okay to run `find` for special targets requiring this macro. However, as of ebb7baf (Makefile: add a hdr-check target, 2018-09-19), $(LIB_H) is part of a global rule and therefore must be expanded. Meaning: this `find` command has to be run upon every `make` invocation. In the presence of many a worktree, this can tax the developers' patience quite a bit. Even in the absence of worktrees or other untracked files and directories, the cost of I/O to generate that list of header files is simply a lot larger than a simple `git ls-files` call. Therefore, just like in 3353397 (Makefile: ask "ls-files" to list source files if available, 2011-10-18), we now prefer to use `git ls-files` to enumerate the header files to enumerating them via `find`, falling back to the latter if the former failed (which would be the case e.g. in a worktree that was extracted from a source .tar file rather than from a clone of Git's sources). This has one notable consequence: we no longer include `command-list.h` in `LIB_H`, as it is a generated file, not a tracked one, but that is easily worked around. Of the three sites that use `LIB_H`, two (`LOCALIZED_C` and `CHK_HDRS`) already handle generated headers separately. In the third, the computed-dependency fallback, we can just add in a reference to $(GENERATED_H). Likewise, we no longer include not-yet-tracked header files in `LIB_H`. Given the speed improvements, these consequences seem a comparably small price to pay. Signed-off-by: Johannes Schindelin <[email protected]>
This is the version that made it to |
orgads
approved these changes
Mar 7, 2019
Thanks, @orgads! |
dscho
added a commit
to dscho/git
that referenced
this pull request
May 13, 2019
…file Accelerate startup time of `make`
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 14, 2019
Accelerate startup time of `make`
dscho
added a commit
that referenced
this pull request
May 21, 2019
Accelerate startup time of `make`
dscho
added a commit
that referenced
this pull request
May 22, 2019
Accelerate startup time of `make`
dscho
added a commit
that referenced
this pull request
May 25, 2019
Accelerate startup time of `make`
dscho
added a commit
that referenced
this pull request
Jun 4, 2019
Accelerate startup time of `make`
dscho
added a commit
that referenced
this pull request
Jun 8, 2019
Accelerate startup time of `make`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a
find
call in theMakefile
to list all the header files that is pretty expensive on Windows, especially in scenarios where there are multiple worktrees as subdirectories of the main worktree, or when there are unrelated worktrees under the main worktree.This patch already made it into git.git's
next
, and I'd like to have it in Git for Windows early, to accelerate my own development (and that of others, too).