Skip to content

Commit 8756f2f

Browse files
committed
update to latest #BenchmarkDotNet version
Former-commit-id: 6ca587c2d3f773d2f430030e2ca0d8d4bd7fe11b Former-commit-id: 01b7b1e4c8fb0146d5efa0d755d0d0f248df5eeb Former-commit-id: 20c535434e174f9adb525313989423a986df908e
1 parent 3878893 commit 8756f2f

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

NuGet.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
44
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
5+
<add key="benchmarkDotNetDevelop" value="https://ci.appveyor.com/nuget/benchmarkdotnet" />
56
</packageSources>
67
</configuration>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using BenchmarkDotNet.Configs;
2+
3+
namespace ImageProcessorCore.Benchmarks
4+
{
5+
public class Config : ManualConfig
6+
{
7+
public Config()
8+
{
9+
// uncomment if you want to use any of the diagnoser
10+
//Add(new BenchmarkDotNet.Diagnostics.MemoryDiagnoser());
11+
//Add(new BenchmarkDotNet.Diagnostics.InliningDiagnoser());
12+
}
13+
}
14+
}
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
namespace ImageProcessorCore.Benchmarks
22
{
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Reflection;
7-
8-
using BenchmarkDotNet.Attributes;
93
using BenchmarkDotNet.Running;
104

115
public class Program
@@ -18,20 +12,7 @@ public class Program
1812
/// </param>
1913
public static void Main(string[] args)
2014
{
21-
// Use reflection for a more maintainable way of creating the benchmark switcher,
22-
Type[] benchmarks = typeof(Program).Assembly.GetTypes()
23-
.Where(t => t.GetMethods(BindingFlags.Instance | BindingFlags.Public)
24-
.Any(m => m.GetCustomAttributes(typeof(BenchmarkAttribute), false).Any()))
25-
.OrderBy(t => t.Namespace)
26-
.ThenBy(t => t.Name)
27-
.ToArray();
28-
29-
// TODO: This throws an exception.
30-
// List<string> x = new List<string>(args) { "diagnosers=MemoryDiagnoser,InliningDiagnoser" };
31-
BenchmarkSwitcher benchmarkSwitcher = new BenchmarkSwitcher(benchmarks);
32-
33-
// benchmarkSwitcher.Run(x.ToArray());
34-
benchmarkSwitcher.Run(args);
15+
new BenchmarkSwitcher(typeof(Program).Assembly).Run(args);
3516
}
3617
}
3718
}

tests/ImageProcessorCore.Benchmarks/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System.Reflection;
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
4+
using BenchmarkDotNet.Attributes;
5+
using ImageProcessorCore.Benchmarks;
46

57
// General Information about an assembly is controlled through the following
68
// set of attributes. Change these attribute values to modify the information
@@ -21,3 +23,5 @@
2123

2224
// The following GUID is for the ID of the typelib if this project is exposed to COM
2325
[assembly: Guid("299d8e18-102c-42de-adbf-79098ee706a8")]
26+
27+
[assembly: Config(typeof(Config))]

tests/ImageProcessorCore.Benchmarks/project.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"emitEntryPoint": true
1414
},
1515
"dependencies": {
16-
"BenchmarkDotNet": "0.9.7",
17-
"BenchmarkDotNet.Diagnostics.Windows": "0.9.7",
16+
"BenchmarkDotNet": "0.9.8-develop",
17+
"BenchmarkDotNet.Diagnostics.Windows": "0.9.8-develop",
1818
"ImageProcessorCore": "1.0.0-*"
1919
},
2020
"commands": {
@@ -24,12 +24,8 @@
2424
"net451": {
2525
"dependencies": {
2626
},
27-
"imports": [
28-
"dnx451"
29-
],
3027
"frameworkAssemblies": {
31-
"System.Drawing": "",
32-
"System.Runtime": ""
28+
"System.Drawing": ""
3329
}
3430
}
3531
}

0 commit comments

Comments
 (0)