twosigma / git-meta

Repository for the git-meta project -- build your own monorepo using Git submodules
http://twosigma.github.io/git-meta
BSD 3-Clause "New" or "Revised" License
219 stars 50 forks source link

`git meta close .` is slow #614

Open abliss opened 6 years ago

abliss commented 6 years ago

It appears to be crawling all submodules to look for ones to close, rather than examining only the ones that are known to be open.

bpeabody commented 6 years ago

How slow? I see about a 400-500ms difference (in a repo with about 8,000 submodules) between git meta close . and git meta close a-submodule-path.

It definitely doesn't crawl the tree though; it uses the same logic to deduce matching paths as open, which works even for sparse submodules (not on disk). I suspect what does account for the extra time is an inefficiency in the way it looks for matching paths -- it should do so against the open set rather than against the entire set (that it currently pares down later against the open set).