A developer has published a comprehensive benchmark comparing .NET 10's regular expression engine against those of Go, Python, C++, and the PCRE2 library. The tests cover a variety of patterns and input sizes, revealing that .NET 10 performs competitively in many common scenarios, sometimes outperforming Go and Python. However, it also shows weaknesses in certain edge cases, particularly with complex backtracking patterns. The benchmark methodology is transparent, with source code available for verification. For .NET developers, this provides concrete data to inform decisions about using regex in performance-critical paths. The results also suggest that .NET's regex engine has improved significantly in recent versions, closing the gap with native libraries. This is a useful reference for any developer working with text processing in .NET, especially those considering migration from other platforms.
A benchmark shows .NET 10 regex performance is competitive with Go, Python, C++, and PCRE2 in many scenarios, with specific strengths and weaknesses.