Re: [PATCH 1/4] fsmonitor: use fsmonitor data in `git diff`

3 messages, 3 authors, 2020-10-19 · open the first message on its own page

Re: [PATCH 1/4] fsmonitor: use fsmonitor data in `git diff`

From: Junio C Hamano <hidden>
Date: 2020-10-19 17:23:34

Taylor Blau [off-list ref] writes:
quoted
quoted
There is some overhead to invoke the hook and talk to watchman, but
I'd expect that to be dwarfed by not having to issue O(# files)
syscalls.
"invoke the hook"---is that a pipe+fork+exec, or something else that
is far lighter-weight?
The former; see 'fsmonitor.c:query_fsmonitor()'.
It brings us back to the "overhead of how many lstat(2) takes us
closer to the overhead of a single pipe+fork+exec plus reading from
the pipe", doesn't it?

Re: [PATCH 1/4] fsmonitor: use fsmonitor data in `git diff`

From: Taylor Blau <hidden>
Date: 2020-10-19 17:37:30

On Mon, Oct 19, 2020 at 10:23:26AM -0700, Junio C Hamano wrote:
Taylor Blau [off-list ref] writes:
quoted
quoted
quoted
There is some overhead to invoke the hook and talk to watchman, but
I'd expect that to be dwarfed by not having to issue O(# files)
syscalls.
"invoke the hook"---is that a pipe+fork+exec, or something else that
is far lighter-weight?
The former; see 'fsmonitor.c:query_fsmonitor()'.
It brings us back to the "overhead of how many lstat(2) takes us
closer to the overhead of a single pipe+fork+exec plus reading from
the pipe", doesn't it?
Somewhat unfortunately, yes. Hopefully any user that cares to use
fsmonitor has enough files in their repository that a pipe+fork+exec is
still faster than however many lstats they would have needed otherwise.

Of course, finding out what that number is is still interesting...

Thanks,
Taylor

Re: [PATCH 1/4] fsmonitor: use fsmonitor data in `git diff`

From: Nipunn Koorapati <hidden>
Date: 2020-10-19 18:07:17

It brings us back to the "overhead of how many lstat(2) takes us
closer to the overhead of a single pipe+fork+exec plus reading from
the pipe", doesn't it?
I will add a benchmark for a `git diff -- <pathspec>`
Somewhat unfortunately, yes. Hopefully any user that cares to use
fsmonitor has enough files in their repository that a pipe+fork+exec is
still faster than however many lstats they would have needed otherwise.

Of course, finding out what that number is is still interesting...
I can try to do some manual testing to figure this out. Doesn't seem like the
type of thing we'd want to add to the benchmark, as it would involve running
git diff on a variety of pathspec workloads

--Nipunn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help