mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-11 23:53:19 -10:00
loadProjectsFile runs on every sidebar read and catalog pass. Its normalizers (project dedupe, pinned list, sidebar order, organization sidecar) find a root with projectIndexByRoot/projectRootInList, and each comparison went through pathidentity.Same, which resolves both paths from scratch. One load therefore cost O(projects^2) identity resolutions; on Windows each resolution opens every ancestor directory and queries its case-sensitivity flag, which matches the Procmon trace in #10738 (about 57k Read-Attributes opens on every project root, 533k QueryCaseSensitiveInformation calls, almost no file content read). pathidentity gains a pass-scoped Matcher that resolves and stats each distinct path once; Same delegates to it, so a single comparison behaves exactly as before. The project-file normalizers share one matcher per pass. Nothing is cached across passes, so a directory whose identity changes is seen fresh on the next load. Test: TestLoadProjectsFileResolvesEachRootLinearly loads 24 projects (pinned, sidebar order, organization sidecar, one symlink alias) and counts identity resolutions. With only the counting seam in place it failed: "loading 24 projects resolved path identity 4400 times, want at most 100"; with the shared matcher it passes, and the alias still folds into its target. TestMatcherResolvesEachDistinctPathOnce checks the matcher agrees with Same on every pair while resolving each path once. Refs #10738