1 of 8

git status mystery

D. Ben Knoble 2019.11.29

2 of 8

Foreshadowing: unrelated trace reveals detail

D. Ben Knoble 2019.11.29

Send to server

fork/exec

wait

3 of 8

Foreshadowing: unrelated trace reveals detail

D. Ben Knoble 2019.11.29

58??

Lack of concurrency?

4 of 8

Observed: git status is slow

D. Ben Knoble 2019.11.29

N commits

1718

N files

246

N files (inc. submodules)

2341 !!!

Size .git

48 MB

Size .git/modules

45 MB

N git submodules

39

Time dclab original

0.069s

Time dclab fixed

0.008s

Time Ben original

0.497s

Time Ben fixed

0.026s

Delta: ~3MB

Human slow!

Not 58...

Red herring

Repo Statistics

5 of 8

Blind experimentation: bad idea

Wasted time with:

  • git gc [--aggressive]: trying to compress/re-pack data
  • git fsck: looking for unreachable nodes (garbage) or broken connections
  • &c.

πŸ€¦β€β™€οΈ

Finally: πŸŽ‰πŸŽ‰πŸŽ‰ git submodule deinit --all πŸŽ‰πŸŽ‰πŸŽ‰ => --ignore-submodules

D. Ben Knoble 2019.11.29

6 of 8

Trace (no-flag)

D. Ben Knoble 2019.11.29

38??

stat

7589, 4.6940ms

exec

153, 2.1093ms

getdents

1879, 2.5028ms

fault

7635, 6.6270ms

IPC

ΒΌ-Β½-1

7 of 8

Trace (flag)

D. Ben Knoble 2019.11.29

stat

1777, 1544.3us

exec

0,0

getdents

97, 221.70us

fault

163, 192.11us

IPC

ΒΎ-1+

8 of 8

Conclusion

  • Good to know about --ignore-submodules flag
    • git config diff.ignoreSubmodules
    • Not new (version 1.7.2)
  • Git status does a lot of (seemingly extra) work for submodules
    • Watch for my message on their mailing list ;)
  • And it isn’t well parallelized
    • CPU usage?
    • Sequential?
  • Quit trying random things and think through the problem!
    • Should have considered submodules much earlier