Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Benchmarks

on:
workflow_dispatch: {} # Allow manual triggering
push:
branches: [develop, master]
pull_request:
branches: [develop, master]

jobs:
benchmark:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '2.1.x'

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Disable broken NuGet source
run: >
dotnet nuget disable source gitversiontemp
--configfile src/NuGet.Config

- name: Restore dependencies
run: >
dotnet restore
./src/DotNet.Glob.Benchmarks/DotNet.Glob.Benchmarks.csproj

- name: Build benchmarks
run: >
dotnet build
./src/DotNet.Glob.Benchmarks/DotNet.Glob.Benchmarks.csproj
-c Release --no-restore -p:SignAssembly=false

- name: Run benchmarks
run: >
dotnet run
--project ./src/DotNet.Glob.Benchmarks/DotNet.Glob.Benchmarks.csproj
-c Release --no-build -p:SignAssembly=false
--framework netcoreapp2.1
Comment thread
dazinator marked this conversation as resolved.

- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results
path: BenchmarkDotNet.Artifacts/**/*
13 changes: 10 additions & 3 deletions src/DotNet.Glob.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Exporters.Csv;

namespace DotNet.Glob.Benchmarks
{
public class Program
{
public static void Main(string[] args)
{
BenchmarkRunner.Run<BaselineRegexGlobCompileBenchmarks>();
BenchmarkRunner.Run<BaselineRegexIsMatchTrueBenchmarks>();
BenchmarkRunner.Run<BaselineRegexIsMatchFalseBenchmarks>();
var config = DefaultConfig.Instance
.With(HtmlExporter.Default)
.With(CsvExporter.Default);

BenchmarkRunner.Run<BaselineRegexGlobCompileBenchmarks>(config);
BenchmarkRunner.Run<BaselineRegexIsMatchTrueBenchmarks>(config);
BenchmarkRunner.Run<BaselineRegexIsMatchFalseBenchmarks>(config);
//BenchmarkRunner.Run<GlobBenchmarks>();
}
}
Expand Down