You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Text.RegularExpressions;
BenchmarkSwitcher.FromAssembly(typeof(Benchmarks).Assembly).Run(args);
[MemoryDiagnoser(false)]
public partial class Benchmarks
{
private Regex _regex;
private string _haystack;
[GlobalSetup]
public async Task Setup()
{
using HttpClient client = new();
_regex = new Regex(await client.GetStringAsync("https://github.com/BurntSushi/rebar/refs/heads/master/benchmarks/regexes/wild/date.txt"), RegexOptions.Compiled);
_haystack = await client.GetStringAsync("https://github.com/BurntSushi/rebar/blob/master/benchmarks/haystacks/rust-src-tools-3b0d4813.txt");
}
[Benchmark]
public int Count() => _regex.Count(_haystack);
}