From d4100ca55f28a562baad5cae50c03aad0403dddc Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 10 Jun 2024 23:17:42 -0700 Subject: [PATCH 1/2] Optimize project scanning on Windows We were using FindFirstFileW instead of FindFirstFileExW, which provides two optimization opportunities for folder scanning: - Specifying FindExInfoBasic avoids computing short file names (cAlternativeFileName), which we never use - Specifying FIND_FIRST_EX_LARGE_FETCH increases the internal buffer sizes used for reading file entries When folder hierarchy is cached (hot), the first optimization improves scan performance by ~10%. When folder hierarchy is read from disk (cold), the second optimization improves scan performance by ~25%. The numbers are measured on Windows 11 / Samsung 970 EVO / x64 on Linux kernel source tree (65k files) --- src/fileutil_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileutil_win.cpp b/src/fileutil_win.cpp index 7fb2c0b..57b0671 100644 --- a/src/fileutil_win.cpp +++ b/src/fileutil_win.cpp @@ -46,7 +46,7 @@ static bool traverseDirectoryRec(const wchar_t* path, const char* relpath, const std::wstring query = path + std::wstring(L"/*"); WIN32_FIND_DATAW data; - HANDLE h = FindFirstFileW(query.c_str(), &data); + HANDLE h = FindFirstFileExW(query.c_str(), FindExInfoBasic, &data, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); if (h == INVALID_HANDLE_VALUE) return false; From eb517557b41a326cadc42d36c7f6a2fe27ce919f Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 11 Jun 2024 00:19:15 -0700 Subject: [PATCH 2/2] Update README.md We do not support Windows Vista now so just remove this line as redundant. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 2de0515..49b730c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ grepping (i.e. full-text searches using regular expressions) over a large set of files. Searches use the database which is a compressed and indexed copy of the source data, thus they are much faster compared to vanilla grep -R. -qgrep runs on Windows (Vista+, XP is not supported), Linux and MacOS X. - Basic setup -----------