4

Git Monorepo Improved Performance

 1 year ago
source link: https://ylan.segal-family.com/blog/2022/10/20/git-monorepo-improved-performance/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Git Monorepo Improved Performance

Oct 20, 2022 • Ylan Segal • git

git recently shipped some performance improvements when working with large repositories, as announced on the GitHub blog.

I tested in a large repository. With default configuration:

$ time git status
On branch master
Your branch is behind 'origin/master' by 686 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean
git status  0.40s user 8.55s system 429% cpu 2.082 total

We then configure fsmonitor and untrackedcache:

$ git config core.fsmonitor true
$ git config core.untrackedcache true

And run twice, to warm up the cache:

$ time git status
On branch master
Your branch is behind 'origin/master' by 686 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean
git status  0.38s user 1.43s system 159% cpu 1.141 total

$ time git status
On branch master
Your branch is behind 'origin/master' by 686 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean
git status  0.13s user 0.03s system 92% cpu 0.178 total

The improvement is quite significant. The end performance is under 200 ms, generally considered to be perceived as instantaneous by users. I’m thrilled!


Find me on Twitter at @ylansegal


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK