Re: git status: small difference between stating whole repository and small subdirectory
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Feb 10, 2012, 12:33 UTC
- Message-ID
- <CACsJy8DnqYZ5CdZqbebWS4NS85mfwumyao0abeqDxMXrHhDELA@mail.gmail.com>
- In-Reply-To
- <CAA01Csr8FbvQ8uFvxX8_6i-hysin6JuaifVVC-yoLyoT0N5F4Q@mail.gmail.com>
On Fri, Feb 10, 2012 at 4:42 PM, Piotr Krukowiecki <piotr.krukowiecki@gmail.com> wrote:
Show 5 quoted lines
> Hi, > > I compared stating whole tree vs one small subdirectory, and I > expected that for the subdirectory status will be very very fast. > After all, it has only few files to stat. But it's not fast. Why?
Because stat'ing is not the only thing git-status does? In order to find out staged changes, unstaged changes and untracked files, it has to do the equivalence of "git diff --cached", "git diff" and "git ls-files -o". I think copy detection is also enabled, which uses more cycles.
Profiling it should give you a good idea what parts cost most.
-- Duy