From 997544077a0ed6535c2eac9f0590f8d7afe0677d Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 4 Jan 2018 09:13:11 -0800 Subject: [PATCH] Use common BDN runner and config (#7186) --- .../ActionSelectorBenchmark.cs | 1 - .../AssemblyInfo.cs | 1 + ...icrosoft.AspNetCore.Mvc.Performance.csproj | 4 +-- .../Program.cs | 17 ---------- .../configs/CoreConfig.cs | 31 ------------------- build/dependencies.props | 1 + build/repo.props | 4 +++ 7 files changed, 8 insertions(+), 51 deletions(-) create mode 100644 benchmarks/Microsoft.AspNetCore.Mvc.Performance/AssemblyInfo.cs delete mode 100644 benchmarks/Microsoft.AspNetCore.Mvc.Performance/Program.cs delete mode 100644 benchmarks/Microsoft.AspNetCore.Mvc.Performance/configs/CoreConfig.cs diff --git a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/ActionSelectorBenchmark.cs b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/ActionSelectorBenchmark.cs index 235766e7ae..ec9c2c5a4b 100644 --- a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/ActionSelectorBenchmark.cs +++ b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/ActionSelectorBenchmark.cs @@ -16,7 +16,6 @@ using Microsoft.Extensions.Logging.Abstractions; namespace Microsoft.AspNetCore.Mvc.Performance { - [Config(typeof(CoreConfig))] public class ActionSelectorBenchmark { private const int Seed = 1000; diff --git a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/AssemblyInfo.cs b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/AssemblyInfo.cs new file mode 100644 index 0000000000..32248e0d1b --- /dev/null +++ b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/AssemblyInfo.cs @@ -0,0 +1 @@ +[assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark] diff --git a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Microsoft.AspNetCore.Mvc.Performance.csproj b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Microsoft.AspNetCore.Mvc.Performance.csproj index 0c2945d238..7a6f1b0fa9 100644 --- a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Microsoft.AspNetCore.Mvc.Performance.csproj +++ b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Microsoft.AspNetCore.Mvc.Performance.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + netcoreapp2.0 Exe true true @@ -14,6 +13,7 @@ + diff --git a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Program.cs b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Program.cs deleted file mode 100644 index e19872fcf2..0000000000 --- a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Reflection; -using BenchmarkDotNet.Running; - -namespace Microsoft.AspNetCore.Mvc.Performance -{ - public class Program - { - public static void Main(string[] args) - { - BenchmarkSwitcher.FromAssembly(typeof(Program).GetTypeInfo().Assembly).Run(args); - } - } -} \ No newline at end of file diff --git a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/configs/CoreConfig.cs b/benchmarks/Microsoft.AspNetCore.Mvc.Performance/configs/CoreConfig.cs deleted file mode 100644 index 381e6f635f..0000000000 --- a/benchmarks/Microsoft.AspNetCore.Mvc.Performance/configs/CoreConfig.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using BenchmarkDotNet.Columns; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Diagnosers; -using BenchmarkDotNet.Engines; -using BenchmarkDotNet.Jobs; -using BenchmarkDotNet.Validators; - -namespace Microsoft.AspNetCore.Mvc.Performance -{ - public class CoreConfig : ManualConfig - { - public CoreConfig() - { - Add(JitOptimizationsValidator.FailOnError); - Add(MemoryDiagnoser.Default); - Add(StatisticColumn.OperationsPerSecond); - - Add(Job.Default - .With(BenchmarkDotNet.Environments.Runtime.Core) - .WithRemoveOutliers(false) - .With(new GcMode() { Server = true }) - .With(RunStrategy.Throughput) - .WithLaunchCount(3) - .WithWarmupCount(5) - .WithTargetCount(10)); - } - } -} \ No newline at end of file diff --git a/build/dependencies.props b/build/dependencies.props index 1da8ce3ff6..fb1b20df8d 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -10,6 +10,7 @@ 2.1.0-preview1-27965 2.1.0-preview1-27965 2.1.0-preview1-27965 + 2.1.0-preview1-27965 2.1.0-preview1-27965 2.1.0-preview1-27965 2.1.0-preview1-27965 diff --git a/build/repo.props b/build/repo.props index be8d80c816..615a1174b8 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,6 +1,10 @@  + + true + +