Skip to content

perf: transitive project graph re-parsed from disk for every project checked by the dependency reducer #253

Description

@credfeto

Found by AI full-repo code analysis (bugs and performance sweep of non-test projects).

Problem

src/Credfeto.DotNet.Repo.Tools.Dependencies/Services/DependencyReducer.cs:126-138 creates a fresh xmlCache/visited per project, so the recursive loaders (lines ~867-915 and ~1003-1054) perform O(P x T) XmlDocument.Load calls per repo (P projects, transitive closure size T) instead of ~P. Dwarfed by build times, but pure waste.

Failure scenario

A 100-project repo with deep reference chains: thousands of redundant csproj parses per repo per run.

Suggested fix

Hoist a repo-level cache keyed by canonical path, evicting entries for files the reducer itself rewrites.

Scope

  • src/Credfeto.DotNet.Repo.Tools.Dependencies/Services/DependencyReducer.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI-WorkWork for an AI AgentLowLow PriorityPerformancePerformance enhancement or issuecredfeto-dotnet-repo-tools-dependenciesChanges in Credfeto.DotNet.Repo.Tools.Dependencies project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions