Skip to content

Perf: Use [GeneratedRegex] where possible#9322

Merged
michaelstaib merged 1 commit intoChilliCream:mainfrom
N-Olbert:GeneratedRegex
Mar 8, 2026
Merged

Perf: Use [GeneratedRegex] where possible#9322
michaelstaib merged 1 commit intoChilliCream:mainfrom
N-Olbert:GeneratedRegex

Conversation

@N-Olbert
Copy link
Copy Markdown
Contributor

@N-Olbert N-Olbert commented Mar 7, 2026

XmlDocumentationProvider contains two frequently used regular expressions that are interpreted rather than compiled. Noticeable performance improvements from #8794 are simply from converting them to [GeneratedRegex]. Since 16 is about to become an RC soon, I assume that XmlDocumentationProvider will remain mostly unchanged, which is why I pulled this change out separately.

A quick search also revealed other places where interpreted regexes - or, in comparison, less optimal regexes using RegexOptions.Compiled - were used. I converted those as well and activated SYSLIB1045 as a warning.

One might argue whether SYSLIB1045 should be active for test projects, but given that Assert.Matches(string pattern, ...) exists, I think it is reasonable.

@michaelstaib michaelstaib added the 🎬 ready Ready to merge label Mar 8, 2026
@michaelstaib michaelstaib merged commit da23045 into ChilliCream:main Mar 8, 2026
123 of 130 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (d2626ce) to head (c31d0ba).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #9322   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants