Skip to content

Avoid per-call allocation in isFilePatternMatch for ignoreCase option#303681

Merged
roblourens merged 2 commits intoroblou/artistic-spiderfrom
copilot/sub-pr-303679-again
Mar 21, 2026
Merged

Avoid per-call allocation in isFilePatternMatch for ignoreCase option#303681
roblourens merged 2 commits intoroblou/artistic-spiderfrom
copilot/sub-pr-303679-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

isFilePatternMatch was allocating { ignoreCase: true } on every invocation when ignoreCase was set. Since this function runs in tight file-walking loops, the repeated allocations add unnecessary GC pressure.

  • Extract a module-level constant filePatternIgnoreCaseOptions = { ignoreCase: true } and reuse it instead of constructing a new object per call

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…d per-call allocations

Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/a131b260-e6c0-47f6-aa2a-95ac0f24fe10
Copilot AI changed the title [WIP] [WIP] Address feedback on caseInsensitive setting for search API in agent tools Avoid per-call allocation in isFilePatternMatch for ignoreCase option Mar 21, 2026
Copilot AI requested a review from roblourens March 21, 2026 04:26
@roblourens roblourens marked this pull request as ready for review March 21, 2026 04:30
@roblourens roblourens merged commit 0060f35 into roblou/artistic-spider Mar 21, 2026
2 of 3 checks passed
@roblourens roblourens deleted the copilot/sub-pr-303679-again branch March 21, 2026 04:30
roblourens added a commit that referenced this pull request Mar 21, 2026
…03679)

* Enable setting caseInsensitive through search API for agent tools
Fix #303673

* Avoid per-call allocation in isFilePatternMatch for ignoreCase option (#303681)

* Initial plan

* Extract filePatternIgnoreCaseOptions as module-level constant to avoid per-call allocations

Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/a131b260-e6c0-47f6-aa2a-95ac0f24fe10

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
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