Skip to content

Commit fe1c355

Browse files
adamsitnikmichellemcdaniel
authored andcommitted
update BenchmarkDotNet to latest version to take advantage of improvements (#511)
* update BenchmarkDotNet to latest version to take advantage of improvements * use FullNameProvider.GetBenchmarkName without reflection since it's public now * update BDN to version that supports .NET Core 5.0 * add 5.0 to the matrix to make sure that this PR really fixes to 5.0 problem * Add private jobs for microbenchmarks for netcoreapp5.0
1 parent 777b576 commit fe1c355

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This project has adopted the code of conduct defined by the Contributor Covenant
2424

2525
| Framework | Windows RS4 x64 | Windows RS4 x86 | Ubuntu 16.04 x64 | Ubuntu 16.04 ARM64 |
2626
| :-------- | :-----------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------: |
27+
| Core 5.0 | [![micro_windows_RS4_x64_netcoreapp5.0_icon]][micro_windows_RS4_x64_netcoreapp5.0_status] | [![micro_windows_RS4_x86_netcoreapp5.0_icon]][micro_windows_RS4_x86_netcoreapp5.0_status] | [![micro_ubuntu_1604_x64_netcoreapp5.0_icon]][micro_ubuntu_1604_x64_netcoreapp5.0_status] | Disabled |
2728
| Core 3.0 | [![micro_windows_RS4_x64_netcoreapp3.0_icon]][micro_windows_RS4_x64_netcoreapp3.0_status] | [![micro_windows_RS4_x86_netcoreapp3.0_icon]][micro_windows_RS4_x86_netcoreapp3.0_status] | [![micro_ubuntu_1604_x64_netcoreapp3.0_icon]][micro_ubuntu_1604_x64_netcoreapp3.0_status] | Disabled |
2829
| Core 2.2 | [![micro_windows_RS4_x64_netcoreapp2.2_icon]][micro_windows_RS4_x64_netcoreapp2.2_status] | | [![micro_ubuntu_1604_x64_netcoreapp2.2_icon]][micro_ubuntu_1604_x64_netcoreapp2.2_status] | N/A |
2930
| Core 2.1 | [![micro_windows_RS4_x64_netcoreapp2.1_icon]][micro_windows_RS4_x64_netcoreapp2.1_status] | | [![micro_ubuntu_1604_x64_netcoreapp2.1_icon]][micro_ubuntu_1604_x64_netcoreapp2.1_status] | N/A |
@@ -53,6 +54,8 @@ This project has adopted the code of conduct defined by the Contributor Covenant
5354
[//]: # (These are the micro links)
5455

5556
[//]: # (These are the windows x64 links)
57+
[micro_windows_RS4_x64_netcoreapp5.0_status]: https://dev.azure.com/dnceng/public/_build/latest?definitionId=271&branchName=master&jobName=windows%20RS4%20x64%20micro&configuration=windows%20RS4%20x64%20micro%20netcoreapp5.0
58+
[micro_windows_RS4_x64_netcoreapp5.0_icon]: https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/performance/performance-ci?branchName=master&jobName=windows%20RS4%20x64%20micro&configuration=windows%20RS4%20x64%20micro%20netcoreapp5.0
5659
[micro_windows_RS4_x64_netcoreapp3.0_status]: https://dev.azure.com/dnceng/public/_build/latest?definitionId=271&branchName=master&jobName=windows%20RS4%20x64%20micro&configuration=windows%20RS4%20x64%20micro%20netcoreapp3.0
5760
[micro_windows_RS4_x64_netcoreapp3.0_icon]: https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/performance/performance-ci?branchName=master&jobName=windows%20RS4%20x64%20micro&configuration=windows%20RS4%20x64%20micro%20netcoreapp3.0
5861
[micro_windows_RS4_x64_netcoreapp2.2_status]: https://dev.azure.com/dnceng/public/_build/latest?definitionId=271&branchName=master&jobName=windows%20RS4%20x64%20micro&configuration=windows%20RS4%20x64%20micro%20netcoreapp2.2
@@ -68,6 +71,8 @@ This project has adopted the code of conduct defined by the Contributor Covenant
6871
[micro_windows_RS4_x86_netcoreapp3.0_icon]: https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/performance/performance-ci?branchName=master&jobName=windows%20RS4%20x86%20micro&configuration=windows%20RS4%20x86%20micro%20netcoreapp3.0
6972

7073
[//]: # (These are the ubuntu x64 links)
74+
[micro_ubuntu_1604_x64_netcoreapp5.0_status]: https://dev.azure.com/dnceng/public/_build/latest?definitionId=271&branchName=master&jobName=ubuntu%201604%20x64%20micro&configuration=ubuntu%201604%20x64%20micro%20netcoreapp5.0
75+
[micro_ubuntu_1604_x64_netcoreapp5.0_icon]: https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/performance/performance-ci?branchName=master&jobName=ubuntu%201604%20x64%20micro&configuration=ubuntu%201604%20x64%20micro%20netcoreapp5.0
7176
[micro_ubuntu_1604_x64_netcoreapp3.0_status]: https://dev.azure.com/dnceng/public/_build/latest?definitionId=271&branchName=master&jobName=ubuntu%201604%20x64%20micro&configuration=ubuntu%201604%20x64%20micro%20netcoreapp3.0
7277
[micro_ubuntu_1604_x64_netcoreapp3.0_icon]: https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/performance/performance-ci?branchName=master&jobName=ubuntu%201604%20x64%20micro&configuration=ubuntu%201604%20x64%20micro%20netcoreapp3.0
7378
[micro_ubuntu_1604_x64_netcoreapp2.2_status]: https://dev.azure.com/dnceng/public/_build/latest?definitionId=271&branchName=master&jobName=ubuntu%201604%20x64%20micro&configuration=ubuntu%201604%20x64%20micro%20netcoreapp2.2

azure-pipelines.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
csproj: src\benchmarks\micro\MicroBenchmarks.csproj
6363
runCategories: 'coreclr corefx'
6464
frameworks: # for public jobs we want to make sure that the PRs don't break any of the supported frameworks
65+
- netcoreapp5.0
6566
- netcoreapp3.0
6667
- netcoreapp2.2
6768
- netcoreapp2.1
@@ -135,6 +136,7 @@ jobs:
135136
csproj: src/benchmarks/micro/MicroBenchmarks.csproj
136137
runCategories: 'coreclr corefx'
137138
frameworks: # for public jobs we want to make sure that the PRs don't break any of the supported frameworks
139+
- netcoreapp5.0
138140
- netcoreapp3.0
139141
- netcoreapp2.2
140142
- netcoreapp2.1
@@ -186,7 +188,8 @@ jobs:
186188
csproj: src\benchmarks\micro\MicroBenchmarks.csproj
187189
runCategories: 'coreclr corefx'
188190
benchviewCategory: 'coreclr'
189-
frameworks: # for private jobs we want to benchmark .NET Core 3.0 only
191+
frameworks: # for private jobs we want to benchmark .NET Core 3.0 and 5.0 only
192+
- netcoreapp5.0
190193
- netcoreapp3.0
191194

192195
# Windows x86 micro benchmarks
@@ -201,7 +204,8 @@ jobs:
201204
csproj: src\benchmarks\micro\MicroBenchmarks.csproj
202205
runCategories: 'coreclr corefx'
203206
benchviewCategory: 'coreclr'
204-
frameworks: # for private jobs we want to benchmark .NET Core 3.0 only
207+
frameworks: # for private jobs we want to benchmark .NET Core 3.0 and 5.0 only
208+
- netcoreapp5.0
205209
- netcoreapp3.0
206210

207211
# Windows x64 ML.NET benchmarks
@@ -247,7 +251,8 @@ jobs:
247251
csproj: src/benchmarks/micro/MicroBenchmarks.csproj
248252
runCategories: 'coreclr corefx'
249253
benchviewCategory: 'coreclr'
250-
frameworks: # for private jobs we want to benchmark .NET Core 3.0 only
254+
frameworks: # for private jobs we want to benchmark .NET Core 3.0 and 5.0 only
255+
- netcoreapp5.0
251256
- netcoreapp3.0
252257

253258
# Ubuntu 1804 x64 ML.NET benchmarks

src/harness/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="BenchmarkDotNet" Version="0.11.3.1003" />
10-
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.3.1003" />
9+
<PackageReference Include="BenchmarkDotNet" Version="0.11.5.1143" />
10+
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.5.1143" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/harness/BenchmarkDotNet.Extensions/PerfLabExporter.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ public override void ExportToLog(Summary summary, ILogger logger)
3030
if (reporter == null) // not running in the perf lab
3131
return;
3232

33-
var nameDelegate = typeof(BenchmarkCase).Assembly.GetType("BenchmarkDotNet.Exporters.FullNameProvider").GetMethod("GetBenchmarkName", BindingFlags.Static | BindingFlags.NonPublic);
34-
35-
3633
foreach (var report in summary.Reports)
3734
{
3835
var test = new Test();
39-
//test.Name = FullNameProvider.GetBenchmarkName(report.BenchmarkCase);
40-
test.Name = (string)nameDelegate.Invoke(null, new[] { report.BenchmarkCase });
36+
test.Name = FullNameProvider.GetBenchmarkName(report.BenchmarkCase);
4137
test.Categories = report.BenchmarkCase.Descriptor.Categories;
4238
var results = from result in report.AllMeasurements
4339
where result.IterationMode == Engines.IterationMode.Workload && result.IterationStage == Engines.IterationStage.Result

src/harness/BenchmarkDotNet.Extensions/RecommendedConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public static IConfig Create(DirectoryInfo artifactsPath, ImmutableHashSet<strin
1818
.WithIterationTime(TimeInterval.FromMilliseconds(250)) // the default is 0.5s per iteration, which is slighlty too much for us
1919
.WithMinIterationCount(15)
2020
.WithMaxIterationCount(20) // we don't want to run more that 20 iterations
21+
.DontEnforcePowerPlan() // make sure BDN does not try to enforce High Performance power plan on Windows
2122
.AsDefault()) // tell BDN that this are our default settings
2223
.WithArtifactsPath(artifactsPath.FullName)
2324
.With(MemoryDiagnoser.Default) // MemoryDiagnoser is enabled by default

0 commit comments

Comments
 (0)