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:
Tim Wojtulewicz 2023-01-18 13:10:33 -07:00 committed by Tim Wojtulewicz
parent d6ce5894a7
commit db161bd6df
4 changed files with 17 additions and 14 deletions

View file

@ -482,7 +482,8 @@ private:
// Directories that have already been searched for dynamic plugins.
// Used to prevent multiple searches of the same dirs (e.g. via symlinks).
// The paths stored in the set are made canonical via realpath().
// The paths stored in the set are made canonical via calls to
// std::filesystem::canonical().
std::set<std::string, std::less<>> searched_dirs;
// Plugins that were explicitly requested to be activated, but failed to