From: Duy Nguyen Date: Thu, 25 Apr 2013 21:20:26 GMT Subject: Re: [PATCH] inotify to minimize stat() calls Message-ID: In-Reply-To: On Fri, Apr 26, 2013 at 2:44 AM, Robert Zeh wrote: >> Can you just replace lstat/stat with cached_lstat/stat inside >> git-compat-util.h and not touch all files at once? I think you may >> need to deal with paths outside working directory. But because you're >> using lookup table, that should be no problem. > > That's a good idea; but there are a few places where you want to call > the uncached stat because calling the cache leads to recursion or > you bump into things that haven't been setup yet. Any ideas how to > handle that? On second thought, no my idea was stupid. We only need to optimize lstat for certain cases and naming cached_lstat is much clearer. I suspect read-cache.c and maybe dir.c and unpack-trees.c are the only places that need cached_lstat. Other places should not issue many lstats and we don't need to touch them. -- Duy