Skip to content

Commit

Permalink
fscache: use FindFirstFileExW to avoid retrieving the short name
Browse files Browse the repository at this point in the history
Use FindFirstFileExW with FindExInfoBasic to avoid forcing NTFS to look up
the short name.  Also switch to a larger (64K vs 4K) buffer using
FIND_FIRST_EX_LARGE_FETCH to minimize round trips to the kernel.

In a repo with ~200K files, this drops warm cache status times from 3.19
seconds to 2.67 seconds for a 16% savings.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
  • Loading branch information
benpeart authored and dscho committed Sep 16, 2022
1 parent 8166572 commit fbd5b1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compat/win32/fscache.c
Expand Up @@ -206,7 +206,8 @@ static struct fsentry *fsentry_create_list(const struct fsentry *dir,
pattern[wlen] = 0;

/* open find handle */
h = FindFirstFileW(pattern, &fdata);
h = FindFirstFileExW(pattern, FindExInfoBasic, &fdata, FindExSearchNameMatch,
NULL, FIND_FIRST_EX_LARGE_FETCH);
if (h == INVALID_HANDLE_VALUE) {
err = GetLastError();
*dir_not_found = 1; /* or empty directory */
Expand Down

0 comments on commit fbd5b1c

Please sign in to comment.