Skip to content

Improve recursive path enumeration performance - #2226

Open
Kire (kireadmin) wants to merge 1 commit into
PowerShell:mainfrom
kireadmin:copilot/perf-stream-directory-enumeration
Open

Kire (kireadmin) wants to merge 1 commit into
PowerShell:mainfrom
kireadmin:copilot/perf-stream-directory-enumeration

Conversation

@kireadmin

Copy link
Copy Markdown

Summary

  • Use lazy directory enumeration in the recursive path walker to avoid allocating arrays of every file and subdirectory before traversal.
  • Preserve traversal order and existing path filtering/analysis behavior.

Validation

  • git diff --check passed.
  • Build/test execution is blocked locally: the repository pins .NET SDK 8.0.419 (only 10.0.401 and 11.0 preview are installed), and restore from the configured Azure Artifacts feed returned 401.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 07:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused API substitutions preserve existing behavior while reducing intermediate allocations.

0 open findings

What changed in this PR

Improves recursive script-path discovery by lazily enumerating directory contents.

Changes:

  • Replaces eager file and directory array allocation with enumeration.
  • Preserves existing traversal and filtering logic.
File Description
Engine/​ScriptAnalyzer.cs Uses lazy filesystem enumeration during path traversal.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants