Skip to content
CAI
Software that uses CAICheck a score

ieviev/resharp-dotnet

53.9

Adequate · 24 September 2026

11.5k

lines of production code

C#

with F#

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Resharp is a high-performance, thread-safe regular expression engine for .NET, designed to offer significant speedups over standard compiled regex. The system optimizes memory layout and reduces overhead through compact data structures and efficient compilation strategies. It supports concurrent matching, Unicode escape sequences, and provides benchmarking tools to compare its performance against .NET's native and source-generated regex implementations.

Features

Add C\# benchmark project and update README with performance comparisons

The repository now includes a C\# benchmark project (Resharp.Benchmarks.csproj) and a corresponding shell script (readme-benchmarks.sh) to generate performance data. The README has been updated to include a NuGet badge, clarify that regex instances are thread-safe, and display new benchmark tables comparing RE\# against .NET's compiled and source-generated regex engines, highlighting significant speedups for complex patterns.

(repo-wide) · high confidence

Added Resharp benchmarks with source-generated regex support

The Resharp.Benchmarks project was introduced to provide performance comparisons between the Resharp regex engine, the standard .NET compiled regex, and a new source-generated regex approach. The benchmark suite includes a menu-driven interface for selecting test cases, loads test data from TOML files, and generates C\# source code containing precompiled regex patterns via the \[GeneratedRegex\] attribute. This allows users to evaluate the performance of Resharp against both traditional compiled regex and the new source-generation technique.

src/Resharp.Benchmarks · high confidence

Behavioural changes

Improved thread safety and memory management for concurrent regex matching

The regex engine now supports concurrent access from multiple threads, allowing a single compiled pattern to be used safely in parallel. Additionally, the engine now releases memory caches after compilation is complete, reducing the memory footprint during matching. The parser also now supports braced Unicode escape sequences (e.g., \\u{1F600}) in addition to standard four-digit escapes.

src/Resharp · high confidence

Optimizes regex engine memory layout and reduces overhead

The regex engine's internal data structures have been refactored to reduce memory footprint and improve performance. In the \RegexNode\ type, transition dictionaries and tuple-based node representations have been replaced with compact arrays, significantly reducing the size of each node. Additionally, unused helper modules and methods related to memory management and set containment checks have been removed, and the \DfaThreshold\ default value has been increased from 10 to 100 to optimize compilation behavior.

Resharp · medium confidence

Test coverage

Add thread-safety and public API tests for the regex engine

Added new test files for the Resharp library: \_17\_ThreadSafetyTests.fs and \_18\_PublicApiTests.fs. The thread-safety tests verify that the shared Regex instance handles concurrent access (IsMatch, Count, Matches, Replace) without race conditions or exceptions. The public API tests cover IsMatch, Count, Matches, ValueMatches, Replace, and FirstEnd behaviors. Updated existing tests in \_02\_NodeTests.fs to use the new NodeFlags enum instead of the old Flag enum, and adjusted pattern matching syntax. Also added a test for node size.

src/Resharp.Test · high confidence

Dependencies

Bumped Resharp version and updated benchmark project configuration

The Resharp library version has been updated to 1.0.5. The Resharp.Benchmarks project has been migrated from F\# to C\#, with the project file renamed and updated to target .NET 10.0, enabling nullable reference types, implicit usings, and a SOURCE\_GEN constant. Additionally, the FSharp.Data package has been removed from the shared package versions, and new test files for thread safety and public API have been added to the test project.

(dependencies) · medium confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 53 → 54 (+0.4)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 67 → 62 (-4.4)
  • Architecture 97 → 90 (-7.0)
  • Maturity 58 → 58 (+0.0)
  • Readiness 39 → 40 (+1.7)
  • Security 77 → 86 (+9.3)
  • Performance 76 → 76 (+0.0)

Resolved (53)

  • Duplicated block (10 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (10 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (10 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (11 lines × 2) (src/Resharp.Runtime/RegexNode.cs)
  • Duplicated block (11 lines × 2) (src/Resharp/Regex.fs)
  • Duplicated block (11 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (12 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (12 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (12 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (13 lines × 2) (lib/runtime-local/StackHelper.cs)
  • Duplicated block (13 lines × 2) (src/Resharp/fsil.fs)
  • Duplicated block (14 lines × 2) (src/Resharp/Optimizations.fs)
  • Duplicated block (14 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (14 lines × 2) (src/Resharp/fsil.fs)
  • Duplicated block (14 lines × 3) (src/Resharp/Types.fs)
  • Duplicated block (15 lines × 2) (lib/runtime-local/StackHelper.cs)
  • Duplicated block (15 lines × 2) (src/Resharp.Runtime/RegexNode.cs)
  • Duplicated block (20 lines × 2) (src/Resharp.Runtime/BDD.cs)
  • Duplicated block (20 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (29 lines × 2) (src/Resharp/Optimizations.fs)
  • …and 33 more

New (67)

  • CoverageExclusion (src/Resharp.Runtime/RegexNode.cs)
  • CoverageExclusion (src/Resharp.Runtime/RegexNode.cs)
  • DeadPreprocessorBranch (lib/runtime-local/HexConverter.cs)
  • DeadPreprocessorBranch (lib/runtime-local/HexConverter.cs)
  • DeadPreprocessorBranch (lib/runtime-local/HexConverter.cs)
  • DeadPreprocessorBranch (lib/runtime-local/HexConverter.cs)
  • DeadPreprocessorBranch (lib/runtime-local/HexConverter.cs)
  • DeadPreprocessorBranch (lib/runtime-local/RegexParseError.cs)
  • DeadPreprocessorBranch (lib/runtime-local/RegexParseException.cs)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (10 lines × 2) (src/Resharp.Runtime/BitVector.cs)
  • Duplicated block (10–14 lines × 2) (src/Resharp.Runtime/RegexNode.cs)
  • Duplicated block (11 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (12 lines × 2) (src/Resharp/fsil.fs)
  • Duplicated block (12–13 lines × 2) (src/Resharp.Runtime/RegexNode.cs)
  • Duplicated block (12–13 lines × 2) (src/Resharp/Info.fs)
  • Duplicated block (13 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (13–15 lines × 2) (src/Resharp/RegexBuilder.fs)
  • Duplicated block (14 lines × 2) (src/Resharp/Regex.fs)
  • …and 47 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ieviev/resharp-dotnet was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 24 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit b4de3892b250f69a148a8eba18c9ce7ae70e0a34 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-923689c465cf.