perf: use [GeneratedRegex] in MetadataFilterMatcher by thomhurst · Pull Request #6094 · thomhurst/TUnit (original) (raw)

@thomhurst

Replace runtime Regex.Replace calls in ExtractFilterHints and the metadata-match path with a source-generated PropertyFilterRegex on net7+, falling back to a cached compiled Regex on netstandard2.0. Avoids re-parsing the pattern per call and is Native AOT friendly.

Closes #6036

[claude[bot]](/apps/claude)

@thomhurst

…egex

Address review: align #if with rest of file (net7 TFM never built) and remove the discarded capturing group to avoid per-match capture overhead.

@thomhurst thomhurst deleted the perf/issue-6036-generatedregex branch

May 28, 2026 21:07

This was referenced

May 29, 2026

This was referenced

Jun 13, 2026

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})