Well, it would be dangerous for me to assume that he uses a combination of stat() calls to develop what seems to have changed, and then, in turn, is really attached to setting the diff'ing engine with this, which This is true.
Here you can see the code for the diff mechanism here . I followed through the codebase to make sure that the status command is actually called into this code (it looks like it does a lot of things!), And actually it all makes a lot of sense when you know that Git works pretty badly on Windows where he uses the emulation layer to make these POSIX calls: he runs git status order of magnitude slower on this platform.
Anyway, without reading all the code from top to bottom (which I can later, if I have the time!), As far as I can take you at the moment ... maybe someone could be more final if they worked with code base.
Note. Another possible speedup comes from the wise use of inline functions, where this clearly makes sense, you can clearly see this in the headers.
[edit: see here for an explanation of stat() ]
jkp Nov 22 '09 at 15:32 2009-11-22 15:32
source share