Skip to content

Regex perf lever 3: drop RegexOptions.ECMAScript (~1.2x) — needs Test262 gating (semantics-sensitive) #929

Description

@nickna

Summary

Deferred perf lever 3 from the regex perf work (PR #887, levers 1+2 shipped). A/B profiling showed RegexOptions.ECMAScript is itself a ~1.2× tax vs default on the benchmark workload — i.e. dropping the ECMAScript option would speed guest-facing regex by ~1.2×.

Why deferred

RegexOptions.ECMAScript changes regex semantics, not just speed, so removing/replacing it is correctness-sensitive. It must be gated behind a full Test262 RegExp run before merge — the regex corpus is exactly where a semantics change would surface.

Notes

  • Levers 1 (Regex.EnumerateMatches, no Match/Group alloc) and 2 (RegexOptions.Compiled) already shipped, taking compiled-vs-Node from 3.20× → 1.61×.
  • The .NET ceiling on this workload is still ~2.3× off Node (Regex.Replace throughput is V8 Irregexp's genuine residual edge); flags alone can't fully close it, so this lever is incremental.
  • Run Test262 one mode at a time (--filter "FullyQualifiedName~Test262InterpretedTests") and build SharpTS.Test262.Worker -c Release first — see the test262 runner notes.

Part of epic #856.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRuntime/codegen performance work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions