Skip to content

[Performance]: Fuse sibling recursive globs during item evaluation #14858

Description

@OvesN

Problem

LazyItemEvaluator.IncludeOperation expands each semicolon-separated GlobFragment independently, even when the globs share the same root and excludes. This repeats full directory-tree walks.

Note: These are repeated logical traversals and matching passes. During normal project evaluation, the shared directory-entry cache usually avoids repeating the underlying physical OS directory enumeration.

For example:

<None Include="Assets\**;**\*.props;**\*.targets" Exclude="obj\**" />

MSBuild currently walks the same project tree once for Assets\**, again for .props, and again for .targets. The proposed optimization would walk the tree once and check all three patterns during that traversal.

Local OrchardCore metrics found 234 zero-result **\*.props requests and 234 zero-result **\*.targets requests. Removing those walks reduced glob time 71.5%, item-pass time 30.0%, and total evaluation 15.4%. #14663 optimizes each traversal but does not reduce their number.

Goal

Prototype one traversal for compatible sibling recursive globs while preserving fragment order, duplicates, original-glob provenance, excludes, and dangerous-glob skip behavior. Validate with OrchardCore and ChangeWave 18.11 enabled.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions