Skip to content
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

Speedup CI and Git by enforcing index-version 4 via update-index #10486

Open
sambacha opened this issue May 10, 2024 · 1 comment
Open

Speedup CI and Git by enforcing index-version 4 via update-index #10486

sambacha opened this issue May 10, 2024 · 1 comment

Comments

@sambacha
Copy link

Is your feature request related to a problem? Please describe.
Monorepo speedups are nice, this is an easy change that will be easily adoptable.

Describe the solution you'd like

Enforce monorepo git configuration

Suggested settings

These settings along with defining a ~/.gitconfig.monorepo configuration file to support commitgraph and native fsmonitor

git config --global pack.allowPackReuse multi
git multi-pack-index write --bitmap
git update-index --verbose --index-version 4

~/.gitconfig.monorepo

[core]
    commitgraph = true
    fsmonitor = true
    writeCommitGraph = true
[feature]
    manyFiles = true

which can be imported through your .gitconfig by

[include]
    path = ~/.gitconfig.monorepo

Update Index version 4

$ git update-index --verbose --show-index-version
2
$ git update-index --verbose --index-version 4
index-version: was 2, set to 4

fsmonitor daemon

see https://github.blog/2022-06-29-improve-git-monorepo-performance-with-a-file-system-monitor/

git config core.fsmonitor true
git fsmonitor--daemon start

core.commitgraph

Git will use a commit history cache to significantly speed up history operations, such as git log with the --graph option.

fetch.writeCommitGraph

Improves performance of commands like git push -f and git log --graph by writing a commit-graph on every git fetch.

References

Faster pack generation with multi-pack reuse

https://github.blog/2024-02-23-highlights-from-git-2-44/

Measuring Git Performance with OpenTel

https://github.blog/2023-10-16-measuring-git-performance-with-opentelemetry/

@tynes
Copy link
Contributor

tynes commented May 10, 2024

Do you have an estimate on how much of a performance boost this would enable?

If i understand correctly, the solution involves adding a config file to the monorepo and then a config file to the host and references the config file in the monorepo? I wish there was a way around that second file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants