mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Reduce startup time on Windows by using std::filesystem::canonical
realpath() apparently doesn't handle Windows symlinks very well. This causes plugin::Manager and ScannedFile to rescan a bunch of extra paths that they should be skipping. This commit reduces the startup time on Windows by 3-4 seconds (~8.5s to ~5s).
This commit is contained in:
parent
d6ce5894a7
commit
db161bd6df
4 changed files with 17 additions and 14 deletions
|
@ -12,7 +12,7 @@ namespace zeek::detail
|
|||
{
|
||||
|
||||
// Script file we have already scanned (or are in the process of scanning).
|
||||
// They are identified by normalized realpath.
|
||||
// They are identified by normalized canonical path.
|
||||
class ScannedFile
|
||||
{
|
||||
|
||||
|
@ -30,7 +30,7 @@ public:
|
|||
bool skipped; // This ScannedFile was @unload'd.
|
||||
bool prefixes_checked; // If loading prefixes for this file has been tried.
|
||||
std::string name;
|
||||
std::string canonical_path; // normalized, absolute path via realpath()
|
||||
std::string canonical_path; // normalized, absolute path via std::filesystem::canonical()
|
||||
|
||||
static auto constexpr canonical_stdin_path = "<stdin>";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue