Re: [PATCH/WIP v2 05/14] read-cache: put some limits on file watching
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jan 20, 2014, 01:36 UTC
- Message-ID
- <CACsJy8Cpno0-z5sgZRsRz6H6Oo+V5qa4UtKqNLT+Cs3Cj420Nw@mail.gmail.com>
- In-Reply-To
- <87ha8zewas.fsf@thomasrast.ch>
On Mon, Jan 20, 2014 at 12:06 AM, Thomas Rast <tr@thomasrast.ch> wrote:
Show 23 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> watch_entries() is a lot of computation and could trigger a lot more >> lookups in file-watcher. Normally after the first set of watches are >> in place, we do not need to update often. Moreover if the number of >> entries is small, the overhead of file watcher may actually slow git >> down. >> >> This patch only allows to update watches if the number of watchable >> files is over a limit (and there are new files added if this is not >> the first time). Measurements on Core i5-2520M and Linux 3.7.6, about >> 920 lstat() take 1ms. Somewhere between 2^16 and 2^17 lstat calls that >> it starts to take longer than 100ms. 2^16 is chosen at the minimum >> limit to start using file watcher. >> >> Recently updated files are not considered watchable because they are >> likely to be updated again soon, not worth the ping-pong game with >> file watcher. The default limit 30min is just a random value. > > But then a fresh clone of a big repository would not get any benefit > from the watcher? > > Not yet sure how to best handle this.
Gaahh, perhaps limit the number of unwatchable recent files to a hundred or so in addition to time limit.
-- Duy