Re: inotify to minimize stat() calls
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 19, 2013, 13:47 UTC
- Message-ID
- <CACsJy8DmPV+61kP6TPCVir-b_xMOWJxoWXunWmvK--7_3cW-iA@mail.gmail.com>
- In-Reply-To
- <CAM9Z-nnWE9LeHaefKdju_p=_he7aJcOunGf1Ms6K=vEXgxS25w@mail.gmail.com>
On Tue, Feb 19, 2013 at 8:16 PM, Drew Northup <n1xim.email@gmail.com> wrote:
Show 10 quoted lines
> Did your testing turn up anything about the amount of time spent > parsing the .gitignore/.gitattributes files? Not the syscall count, > but the actual time spent running the parser (which I presume is > largely CPU-bound). The other notable bit of information to know would > be how much time is spent applying what has been parsed out of those > files to the content of the tree. Both will give a clear signal of the > prominence of those segments of code versus others elsewhere in the > "git stat" flow path. That information will tell us more clearly what, > if anything, it is worth keeping a cache of and what form that cache > should take.
Not specifically parsing, but we do waste CPU on .gitignore/.gitattributes stuff. See
http://thread.gmane.org/gmane.comp.version-control.git/216347/focus=216381
Other measurements (which led to the above patch):
http://thread.gmane.org/gmane.comp.version-control.git/215820/focus=215900 http://thread.gmane.org/gmane.comp.version-control.git/215820/focus=216029 http://thread.gmane.org/gmane.comp.version-control.git/215820/focus=216195
So far we could reduce lstat, {open,read,close}dir syscalls with the help of inotify, which saves time. I'm not sure if we should cache the list of untracked-but-not-ignored files. It cuts down cpu time on .gitignore but invalidation could be complicated.
-- Duy