Skip to main content

Benchmark regex execution

Benchmark Regex measures repeated executions of the selected pattern and input on your computer. Use it to compare alternatives under the same conditions.

Free
Unavailable
Pro
Included
Self-hosted
Included
Compare plans

Run a benchmark​

  1. Select the engine that matches your application.
  2. Enter the pattern and a representative input.
  3. Open Benchmark Regex in the tools menu.
  4. Wait for the measured run to finish.
  5. Record the pattern, flags, input, browser, and computer with the results.
  6. Change one part of the pattern.
  7. Run the benchmark again with the same input and configuration.

In Unit Tests mode, open a test row's actions menu (⋮). Select Benchmark Test. The benchmark uses that test's Test string with the current pattern, flags, and engine.

Cancel benchmark stops an active run. After a run finishes, Run again repeats it.

Set Benchmark duration in Settings > Matching > Automation & benchmarks. The duration range is 2.5 to 240 seconds.

For a small PCRE2 comparison, use these two patterns with no flags:

^ORD-[0-9]{4}$
^ORD-[0-9][0-9][0-9][0-9]$

Both match ORD-0042 and reject ORD-42, ORD-00420, and XORD-0042. Run both expressions to compare their measured execution times.

Run each input separately. Keep timing results for successful matches and rejected inputs separate.

Measurements​

Latency measures regex execution time. It does not measure complete application response time.

ResultMeaning
Measured samplesExecutions included in the reported results. Warmup runs are separate.
Typical latencyMedian and average execution time for the selected input.
Tail latencyPercentile and slow-sample measurements from this run.
JitterVariation between samples, including standard deviation.
ThroughputOperations per second derived from the measured execution times.

Read How this is measured below the charts for details about warmup runs and chart grouping.

Very short timings are limited by the engine clock precision. Throughput estimates do not represent complete application performance.

Charts​

The Execution timeline shows how latency changes during a run. Rolling median and percentile lines help you compare typical behavior with slower samples.

For larger runs, the chart can group samples.

The Latency distribution groups times into ranges. The cumulative share shows how much of the sample set falls within those ranges.

Example result​

This screenshot uses JavaScript with the g flag and this pattern:

\bORD-(?<id>[0-9]{4})\b

Input:

ORD-0042 pending
ORD-0187 sent
ORD-42 invalid
XORD-0001 invalid

The sample count and timings vary between runs.

One captured run of the order-ID example. The displayed timings depend on that run's engine, input, and local environment.
Benchmark results with the measured sample count, latency summary, and complete execution timeline.

How to read a run​

Repeat the comparison before drawing a conclusion. Browser activity, system load, and the selected input can affect the result.

Results cover the selected pattern and input. Include both successful matches and inputs that fail near the end of a match. A timeout stops that run. Benchmark results do not establish a worst-case execution bound.

If a run stops​

An execution that exceeds the configured maximum execution time stops the benchmark. Engine initialization and matching errors also stop it.

If a run stops, reduce the input to a small reproduction. Resolve syntax or engine errors before repeating the comparison.