On Mon, Jan 20, 2014 at 12:06 AM, Thomas Rast <t...@thomasrast.ch> wrote:
> Nguyễn Thái Ngọc Duy <pclo...@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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to