Skip to content

Commit

Permalink
Fix benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDunn committed Aug 18, 2024
1 parent 45122ae commit cce9946
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Benchmark.Net Example
name: Benchmarks
on:
push:
branches:
Expand All @@ -10,22 +10,22 @@ permissions:

jobs:
benchmark:
name: Run Benchmark.Net benchmarks
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.300' # SDK Version to use. keep in line with src/Benchmarks/global.json
- name: Run benchmark
run: cd src/Benchmarks/ && dotnet build -c release && dotnet run -c Release -- --no-build --exporters json --filter '*' --job short
run: cd src/Benchmarks/ && dotnet run -c Release -- --no-build --exporters json --filter '*' --job short

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Benchmark.Net Benchmark
tool: 'benchmarkdotnet'
output-file-path: src/Benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks-report-full-compressed.json
output-file-path: src/Benchmarks/BenchmarkDotNet.Artifacts/results/FromNameBenchmarks-report-full-compressed.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
Expand Down
7 changes: 7 additions & 0 deletions Intellenum.sln
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Intellenum.Pack", "src\Inte
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Intellenum.CodeFixers", "src\Intellenum.CodeFixers\Intellenum.CodeFixers.csproj", "{C9F36C6C-62E5-4B86-80E2-E11EFA6EB6A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "src\Benchmarks\Benchmarks.csproj", "{D00EB209-1399-428C-9AE0-8FA16E9F5ECE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -96,6 +98,10 @@ Global
{C9F36C6C-62E5-4B86-80E2-E11EFA6EB6A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9F36C6C-62E5-4B86-80E2-E11EFA6EB6A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9F36C6C-62E5-4B86-80E2-E11EFA6EB6A6}.Release|Any CPU.Build.0 = Release|Any CPU
{D00EB209-1399-428C-9AE0-8FA16E9F5ECE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D00EB209-1399-428C-9AE0-8FA16E9F5ECE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D00EB209-1399-428C-9AE0-8FA16E9F5ECE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D00EB209-1399-428C-9AE0-8FA16E9F5ECE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -111,6 +117,7 @@ Global
{83488ED4-6EB4-42B2-BFAC-D75B02A6F9A6} = {9955BB98-6ACF-4EC8-AE59-1B8DDCCBDCC6}
{9AD47881-A2A6-48A2-A640-2F730AFFB188} = {57174048-09D4-46A6-932C-8F90F2B603D0}
{C9F36C6C-62E5-4B86-80E2-E11EFA6EB6A6} = {57174048-09D4-46A6-932C-8F90F2B603D0}
{D00EB209-1399-428C-9AE0-8FA16E9F5ECE} = {57174048-09D4-46A6-932C-8F90F2B603D0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E4D5DD02-533B-4333-9CF9-ACD294C7F2EE}
Expand Down
2 changes: 2 additions & 0 deletions src/Benchmarks/AccessingValuesBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/// <summary>
/// Benchmark for accessing the values of the enums.
/// </summary>
[JsonExporterAttribute.Full]
[JsonExporterAttribute.FullCompressed]
[MemoryDiagnoser]
public class AccessingValuesBenchmarks
{
Expand Down
2 changes: 2 additions & 0 deletions src/Benchmarks/FromNameBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using BenchmarkDotNet.Attributes;

[JsonExporterAttribute.Full]
[JsonExporterAttribute.FullCompressed]
[MemoryDiagnoser]
[SuppressMessage("Performance", "CA1822:Mark members as static")]
public class FromNameBenchmarks
Expand Down
2 changes: 2 additions & 0 deletions src/Benchmarks/FromValueBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using BenchmarkDotNet.Attributes;

[JsonExporterAttribute.Full]
[JsonExporterAttribute.FullCompressed]
[MemoryDiagnoser]
public class FromValueBenchmarks
{
Expand Down
2 changes: 2 additions & 0 deletions src/Benchmarks/IsDefinedBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/// <summary>
/// Benchmark for seeing if a value is defined.
/// </summary>
[JsonExporterAttribute.Full]
[JsonExporterAttribute.FullCompressed]
[MemoryDiagnoser]
public class IsDefinedBenchmarks
{
Expand Down
2 changes: 2 additions & 0 deletions src/Benchmarks/ToStringBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using BenchmarkDotNet.Attributes;

[JsonExporterAttribute.Full]
[JsonExporterAttribute.FullCompressed]
[MemoryDiagnoser]
public class ToStringBenchmarks
{
Expand Down

0 comments on commit cce9946

Please sign in to comment.