Skip to content
CAI
Software that uses CAICheck a score

ieviev/resharp-dotnet

53.3

Adequate · 13 November 2026

11.5k

lines of production code

C#

with F#

8

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 implemented in F\# that supports concurrent matching and modern Unicode escape syntax. It provides a public API for pattern matching and replacement while optimizing memory usage and compilation speed through internal structural refactoring. The system includes a comprehensive benchmarking suite that compares its runtime performance against .NET's compiled and source-generated regex implementations.

Behavioural changes

Benchmarks now compare Resharp against .NET compiled and source-generated regexes

The benchmark suite has been rewritten to evaluate Resharp's performance against two other approaches: standard compiled .NET Regexes and .NET source-generated Regexes. The new setup loads test definitions from TOML files, allowing users to run benchmarks for specific groups or individual cases via a console menu. It also includes a code generation step (\--generate\) that produces a \SourceGenRegexes.g.cs\ file containing \\[GeneratedRegex\]\ attributes for selected patterns, enabling a direct comparison of runtime performance across these three implementation strategies.

src/Resharp.Benchmarks · high confidence

Regex engine now supports concurrent matching and braced Unicode escapes

The regex engine is now thread-safe, allowing a single compiled instance to be used concurrently from multiple threads without external synchronization. Additionally, the parser now supports braced Unicode escape sequences (e.g., \\u{1F600}) in addition to the standard four-digit format. To support these changes, the internal node representation has been refactored to use arrays instead of linked structures, and cache memory is now explicitly released after pattern compilation.

src/Resharp · high confidence

Resharp regex engine refactored for memory efficiency and performance

The Resharp regex engine has been refactored to reduce memory overhead and improve performance. Key changes include restructuring the internal \RegexNode\ discriminated union to use packed arrays instead of tuples or multiple dictionaries, which leverages F\# struct field sharing to reduce memory footprint. The \DfaThreshold\ configuration option has been increased from 10 to 100 to optimize compilation state space handling. Several internal helper modules and methods (such as \Memory.forall\, \Common.contains\, and \PooledArray.AsMemory\) have been removed as part of the cleanup. Additionally, the \printNode\ helper now accepts a \getTset\ function to resolve character sets, and lookaround printing logic has been updated to handle empty pending sets and specific anchor patterns more cleanly.

Resharp · high confidence

Updated documentation and benchmarking infrastructure

The README now includes a NuGet version badge and clarifies that Regex instances are thread-safe, encouraging reuse. The performance section has been expanded to include benchmarks against .NET's SourceGenerated engine and additional custom patterns, with a new shell script (readme-benchmarks.sh) to run these comparisons. The benchmark project has been migrated from F\# to C\#, and the .gitignore has been updated to exclude experiment and speedscope artifacts.

(repo-wide) · high confidence

Test coverage

Added thread safety, public API, and performance optimization tests

Added comprehensive test coverage for the Resharp regex engine, including new files for thread safety validation (concurrent access to shared Regex instances), public API behavior (IsMatch, Count, Matches, Replace, ValueMatches), and SetLookup performance optimizations using SearchValues. Updated existing tests to reflect internal refactoring, such as changes to NodeFlags usage, prefix set calculation signatures, and pattern matching syntax, and added regression tests for complex intersection and complement patterns to ensure they terminate correctly.

src/Resharp.Test · high confidence

Dependencies

Benchmark project migrated to C\# and version bumped to 1.0.6

The benchmarking project has been converted from F\# to C\#, updating the project file from .fsproj to .csproj and enabling nullable reference types and implicit usings. The FSharp.Data dependency was removed from the central package management file. Additionally, the main library version was incremented to 1.0.6, and new test files for thread safety, public API, and set lookup were added to the test suite.

(dependencies) · high confidence

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

How this codebase got here

Score

  • CAI 51 → 53 (+2.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 62 → 59 (-3.1)
  • Architecture 88 → 88 (+0.0)
  • Maturity 56 → 58 (+2.0)
  • Readiness 36 → 41 (+5.1)
  • Security 83 → 93 (+10.8)
  • Performance 76 → 69 (-7.6)

Resolved (12)

  • IL efficiency: 41 authored method(s) exceed the IL budget
  • Leaked secret: hardcoded-credential (data/samples/regexlibpatterns.json)
  • Leaked secret: high-entropy-secret (src/Resharp.Benchmarks/benchmarks/definitions/curated/13-noseyparker.toml)
  • Leaked secret: high-entropy-secret (src/Resharp.Benchmarks/benchmarks/definitions/curated/13-noseyparker.toml)
  • Low XML-doc coverage: Resharp.Benchmarks (src/Resharp.Benchmarks/Resharp.Benchmarks.csproj)
  • Projects may be oversized for their cohesion
  • Secret: aws-access-token (src/Resharp.Benchmarks/benchmarks/haystacks/wild/cpython-226484e4.py)
  • Secret: aws-access-token (src/Resharp.Benchmarks/benchmarks/haystacks/wild/cpython-226484e4.py)
  • Secret: aws-access-token (src/Resharp.Benchmarks/benchmarks/haystacks/wild/cpython-226484e4.py)
  • Secret: aws-access-token (src/Resharp.Benchmarks/benchmarks/haystacks/wild/cpython-226484e4.py)
  • Secret: generic-api-key (src/Resharp.Benchmarks/benchmarks/definitions/curated/13-noseyparker.toml)
  • XML-doc coverage: Resharp.Runtime(net8.0) (src/Resharp.Runtime/Resharp.Runtime.csproj)

New (14)

  • Edited copy of a member (11 corresponding lines) (lib/runtime-local/ValueStringBuilder.cs)
  • Edited copy of a member (13 corresponding lines) (lib/runtime-local/ValueListBuilder.cs)
  • Edited copy of a member (13 corresponding lines) (lib/runtime-local/ValueStringBuilder.cs)
  • Edited copy of a member (13 corresponding lines) (src/Resharp.Runtime/RegexCharClass.cs)
  • Edited copy of a member (14 corresponding lines) (src/Resharp.Runtime/BitVector.cs)
  • Edited copy of a member (14 corresponding lines) (src/Resharp.Runtime/BitVectorSolver.cs)
  • Edited copy of a member (19 corresponding lines) (src/Resharp.Runtime/BitVectorSolver.cs)
  • Edited copy of a member (26 corresponding lines) (src/Resharp.Runtime/BDD.cs)
  • Edited copy of a member (7 corresponding lines) (lib/runtime-local/HexConverter.cs)
  • Projects may be oversized for their cohesion (src/Resharp.Runtime/Resharp.Runtime.csproj)
  • GetMintermID spells ID where 59 names in the project spell it Id (src/Resharp.Runtime/MintermClassifier.cs)
  • doc comments repeat the names (lib/runtime-local/RegexParseError.cs)
  • redundant comment (lib/runtime-local/ValueListBuilder.cs)
  • redundant comment (lib/runtime-local/ValueStringBuilder.cs)

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.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 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit c807df9e660a7d5273808485740c43f30da55a7f — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-b8b1a43ae4c3.