Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix benchmarks #23827

Merged
merged 3 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="xunit.assert" Version="$(XunitVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsConfigurationJsonVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesVersion)" />
Expand Down
37 changes: 1 addition & 36 deletions benchmark/EFCore.Benchmarks/EFCoreBenchmarkRunner.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
// 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.Linq;
using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Exporters.Csv;
using BenchmarkDotNet.Horology;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

namespace Microsoft.EntityFrameworkCore.Benchmarks
Expand All @@ -20,33 +11,7 @@ public static class EFCoreBenchmarkRunner
{
public static void Run(string[] args, Assembly assembly, IConfig config = null)
{
if (config == null)
{
config = DefaultConfig.Instance;
}

config = config.With(DefaultConfig.Instance.GetDiagnosers().Concat(new[] { MemoryDiagnoser.Default }).ToArray());

var index = Array.FindIndex(args, s => s == "--perflab");
if (index >= 0)
{
var argList = args.ToList();
argList.RemoveAt(index);
args = argList.ToArray();

config = config
.With(StatisticColumn.OperationsPerSecond, new ParamsSummaryColumn())
.With(
MarkdownExporter.GitHub, new CsvExporter(
CsvSeparator.Comma,
new SummaryStyle(
printUnitsInHeader: true,
SizeUnit.KB,
TimeUnit.Microsecond,
printUnitsInContent: false)));
}

BenchmarkSwitcher.FromAssembly(assembly).Run(args, config);
BenchmarkSwitcher.FromAssembly(assembly).Run(args);
}
}
}