Skip to content

Commit 6d9c217

Browse files
authored
Merge pull request #93 from xin9le/refactor/benchmark
Refactor benchmark configuration
2 parents 9fecef1 + 9bc2087 commit 6d9c217

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

src/insights/FastEnum.Benchmarks/FastEnum.Benchmarks.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
45
<OutputType>Exe</OutputType>
56
<RootNamespace>FastEnumUtility.Benchmarks</RootNamespace>
67
</PropertyGroup>

src/insights/FastEnum.Benchmarks/Internals/BenchmarkConfig.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,28 @@ namespace FastEnumUtility.Benchmarks.Internals;
1010
internal static class BenchmarkConfig
1111
{
1212
public static IConfig ForDefault()
13-
{
14-
return ManualConfig.CreateMinimumViable()
15-
.AddExporter(MarkdownExporter.GitHub)
16-
.AddDiagnoser(MemoryDiagnoser.Default)
17-
.AddJob(Job.Default);
18-
}
13+
=> CreateSharedConfig(Job.Default);
1914

2015

2116
public static IConfig ForShortRun()
17+
=> CreateSharedConfig(Job.ShortRun);
18+
19+
20+
#region Helpers
21+
private static ManualConfig CreateSharedConfig(Job job)
2222
{
23-
return ManualConfig.CreateMinimumViable()
23+
return ManualConfig
24+
.CreateMinimumViable()
2425
.AddExporter(MarkdownExporter.GitHub)
2526
.AddDiagnoser(MemoryDiagnoser.Default)
26-
.AddJob(Job.ShortRun);
27+
.AddDiagnoser(new DisassemblyDiagnoser(new
28+
(
29+
maxDepth: 3,
30+
printSource: true,
31+
exportGithubMarkdown: true,
32+
exportCombinedDisassemblyReport: true
33+
)))
34+
.AddJob(job);
2735
}
36+
#endregion
2837
}

0 commit comments

Comments
 (0)