-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add a helper script to run the benchmarks. - Fix `-- pick` not working.
- Loading branch information
1 parent
cc28c5e
commit 71b760a
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env pwsh | ||
|
||
Param( | ||
[string]$Configuration = "Release", | ||
[switch]$Interactive | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
$ProgressPreference = "SilentlyContinue" | ||
|
||
Write-Host "Running benchmarks..." | ||
|
||
$additionalArgs = @() | ||
|
||
if ($Interactive -ne $true) { | ||
$additionalArgs += "--" | ||
$additionalArgs += "--filter" | ||
$additionalArgs += "*" | ||
} | ||
|
||
$project = Join-Path "src" "Polly.Core.Benchmarks" "Polly.Core.Benchmarks.csproj" | ||
|
||
dotnet run --configuration $Configuration --framework net7.0 --project $project $additionalArgs | ||
|
||
exit $LASTEXITCODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Benchmarks | ||
|
||
To run the benchmarks: | ||
To run the benchmarks, use the `benchmarks.ps1` script in the root of the repository: | ||
|
||
``` powershell | ||
# run all benchmarks | ||
dotnet run -c release -f net7.0 | ||
# Run all benchmarks | ||
./benchmarks.ps1 | ||
# pick benchmarks to run | ||
dotnet run -c release -f net7.0 -- pick | ||
# Pick benchmarks to run | ||
./benchmarks.ps1 -Interactive | ||
``` | ||
|
||
The benchmark results are stored in [`BenchmarkDotNet.Artifacts/results`](BenchmarkDotNet.Artifacts/results/) folder. | ||
|
||
Run the benchmarks when your changes are significant enough to make sense running them. We do not use fixed hardware so your numbers might differ, however the important is the `Ratio` and `Alloc Ratio` which stays around the same or improves (ideally) between runs. | ||
Run the benchmarks when your changes are significant enough to make sense running them. We do not use fixed hardware so your numbers might differ, however the important is the `Ratio` and `Alloc Ratio` which stays around the same or improves (ideally) between runs. |