New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FSMonitor Preliminary Commits #860
FSMonitor Preliminary Commits #860
Conversation
/submit |
Submitted as pull.860.git.1612216941.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
@@ -165,7 +165,7 @@ test_fsmonitor_suite() { | |||
' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
"Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Jeff Hostetler <jeffhost@microsoft.com>
>
> The Mac version of xargs does not support the "-d" option. Convert the test
> setup to pipe the data set thru `lf_to_nul | xargs -0` instead.
"xargs -0" is not all that portable, either, and neither is "touch -h".
But since the t/perf stuff already depends on having GNU toolchain
anyway, I can be persuaded to believe that it is OK.
Do we know that this part runs much later than the staged files are
last touched, so that these uses of "touch" actually are effective
to make the paths stat-dirty? Otherwise, we may be just "touch"ing
them with the timestamp they already have after all.
Thanks.
> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
> ---
> t/perf/p7519-fsmonitor.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh
> index 9b43342806b..7bb37e9a6c1 100755
> --- a/t/perf/p7519-fsmonitor.sh
> +++ b/t/perf/p7519-fsmonitor.sh
> @@ -165,7 +165,7 @@ test_fsmonitor_suite() {
> '
>
> test_perf_w_drop_caches "status (dirty) ($DESC)" '
> - git ls-files | head -100000 | xargs -d "\n" touch -h &&
> + git ls-files | head -100000 | lf_to_nul | xargs -0 touch -h &&
> git status
> '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jeff Hostetler wrote (reply to this):
On 2/1/21 6:25 PM, Junio C Hamano wrote:
> "Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Jeff Hostetler <jeffhost@microsoft.com>
>>
>> The Mac version of xargs does not support the "-d" option. Convert the test
>> setup to pipe the data set thru `lf_to_nul | xargs -0` instead.
>
> "xargs -0" is not all that portable, either, and neither is "touch -h".
>
> But since the t/perf stuff already depends on having GNU toolchain
> anyway, I can be persuaded to believe that it is OK.
>
> Do we know that this part runs much later than the staged files are
> last touched, so that these uses of "touch" actually are effective
> to make the paths stat-dirty? Otherwise, we may be just "touch"ing
> them with the timestamp they already have after all.
I'm not sure now that you mention it. I suppose on modern filesystems
that have mtimes with nanosecond fields we could (are) assuming that
"touch" is actually doing something. On older filesystems (such as
FAT32), you're right it is probably not doing anything at the speed
that the test runs.
TBH I'm not sure that the test needs the "-h". Symlinks are not that
common and it shouldn't affect the timings that much if there are a few.
I'm not sure what to do about "-0". Not even "--null" is portable.
Let me do a little digging here.
>
> Thanks.
>
>> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
>> ---
>> t/perf/p7519-fsmonitor.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh
>> index 9b43342806b..7bb37e9a6c1 100755
>> --- a/t/perf/p7519-fsmonitor.sh
>> +++ b/t/perf/p7519-fsmonitor.sh
>> @@ -165,7 +165,7 @@ test_fsmonitor_suite() {
>> '
>>
>> test_perf_w_drop_caches "status (dirty) ($DESC)" '
>> - git ls-files | head -100000 | xargs -d "\n" touch -h &&
>> + git ls-files | head -100000 | lf_to_nul | xargs -0 touch -h &&
>> git status
>> '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
Jeff Hostetler <git@jeffhostetler.com> writes:
> I'm not sure now that you mention it. I suppose on modern filesystems
> that have mtimes with nanosecond fields we could (are) assuming that
> "touch" is actually doing something. On older filesystems (such as
> FAT32), you're right it is probably not doing anything at the speed
> that the test runs.
That one is probably the most relevant nit among the ones I raised.
I do not actually mind if we used test-chmtime to force our own
timestamp (e.g. "5 seconds before the filesystem time"), and added
the helper the "--stdin" option to read paths to work around the
"xargs" issue.
> TBH I'm not sure that the test needs the "-h". Symlinks are not that
> common and it shouldn't affect the timings that much if there are a few.
I agree.
> I'm not sure what to do about "-0". Not even "--null" is portable.
Correct. I do not think it is worth "digging", though. I do not
mind "ls-files -z | test-tool chmtime -600 --stdin -z" to lose
xargs, but we already depend on GNU time to run t/perf, and it is
not too far a stretch to require GNU xargs that knows "-0" or "-d".
Thanks.
User |
Convert the test to use a more portable method to update the mtime on a large number of files under version control. The Mac version of xargs does not support the "-d" option. Likewise, the "-0" and "--null" options are not portable. Furthermore, use `test-tool chmtime` rather than `touch` to update the mtime to ensure that it is actually updated (especially on file systems with only whole second resolution). Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Only use the final portion of the test trash directory file name when verifying that Watchman was started. On Windows and under the SDK, $GIT_WORKTREE is a cygwin-style path with forward slashes and a "/c/" drive name. However `watchman watch-list` reports a proper Windows-style pathname with drive letters and backslashes. This causes the grep to fail. Since we don't really care about the full pathname (and we really don't want to bother with normalizaing them), just see if the test-name portion of the path is found. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Shutdown Watchman after the Watchman-based tests and before the block of "no fsmonitor" tests. This helps ensure that Watchman cannot affect the test results for the other. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Add optional trace logging to allow us to better compare performance of various fsmonitor providers and compare results with non-fsmonitor runs. Currently, this includes Trace2 logging, but may be extended to include other trace targets, such as GIT_TRACE_FSMONITOR if desired. Using this logging helped me explain an odd behavior on MacOS where the kernel was dropping events and causing the hook to Watchman to timeout. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Report the total number of calls made to lstat() inside preload_index(). FSMonitor improves the performance of commands like `git status` by avoiding scanning the disk for changed files. This can be seen in `preload_index()`. Let's measure this. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Report the total number of calls made to lstat() inside of refresh_index(). FSMonitor improves the performance of commands like `git status` by avoiding scanning the disk for changed files. This can be seen in `refresh_index()`. Let's measure this. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Report the number of files in the working directory that were read and their hashes verified in `refresh_index()`. FSMonitor improves the performance of commands like `git status` by avoiding scanning the disk for changed files. Let's measure this. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Let's measure the time taken to request and receive FSMonitor data via the hook API and the size of the response. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Allow fsmonitor to report directory changes by reporting paths with a trailing slash. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Kevin Willford <Kevin.Willford@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Isolate and document initialization of `istate->fsmonitor_last_update`. This field should contain a fsmonitor-specific opaque token, but we need to initialize it before we can actually talk to a fsmonitor process, so we create a generic default value. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
4686196
to
5410d3a
Compare
/submit |
Submitted as pull.860.v2.git.1612366490.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Taylor Blau wrote (reply to this):
|
User |
On the Git mailing list, Jeff Hostetler wrote (reply to this):
|
User |
This branch is now known as |
This patch series was integrated into seen via git@3919a38. |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into seen via git@034918a. |
This patch series was integrated into seen via git@3aadfd4. |
This patch series was integrated into seen via git@a6a7d5f. |
This patch series was integrated into next via git@1943efb. |
This patch series was integrated into seen via git@2561cba. |
This patch series was integrated into seen via git@324a60d. |
This patch series was integrated into seen via git@2845b05. |
This patch series was integrated into seen via git@d1b26b0. |
This patch series was integrated into seen via git@a1aaf75. |
This patch series was integrated into seen via git@700696b. |
This patch series was integrated into next via git@700696b. |
This patch series was integrated into master via git@700696b. |
Closed via 700696b. |
Here is version 2 of this series.
In version 1, I replaced the non-portable "xargs -d" with "xargs -0", but
it turns out that that too is not universally available. In this version I
replace the need for either one by filtering out the problematic paths
(such as ones with LFs) and quoting paths to handle whitespace. The
resulting paths can be passed to xargs without any arguments.
Also, I updated the test to use
test-tool chmtime
rather thantouch
to ensure that the files actually look dirty on low-resolution file systems.
cc: Taylor Blau me@ttaylorr.com
cc: Jeff Hostetler git@jeffhostetler.com