Skip to content

Commit

Permalink
Merge branch 'master' into fair-types
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/BenchmarkDotNet/Engines/Consumer.cs
  • Loading branch information
timcassell committed Jan 14, 2024
2 parents bd88b1e + 1d95e55 commit d602146
Show file tree
Hide file tree
Showing 321 changed files with 6,131 additions and 2,382 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/publish-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: nupkgs
path: "**/*.nupkg"
path: "**/*.*nupkg"
- name: Publish nupkg
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
run: .dotnet/dotnet nuget push **/*.nupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600
- name: Publish snupkg
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
run: .dotnet/dotnet nuget push **/*.snupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600
run: ./.dotnet/dotnet nuget push **/*.nupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600
40 changes: 23 additions & 17 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
Expand All @@ -20,14 +20,10 @@ jobs:
- uses: actions/checkout@v3
- name: Run task 'build'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd build
run: ./build.cmd build
- name: Run task 'in-tests-core'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd in-tests-core -e
run: ./build.cmd in-tests-core -e
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
Expand All @@ -44,14 +40,10 @@ jobs:
- uses: actions/checkout@v3
- name: Run task 'build'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd build
run: ./build.cmd build
- name: Run task 'in-tests-full'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd in-tests-full -e
run: ./build.cmd in-tests-full -e
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
Expand Down Expand Up @@ -99,17 +91,31 @@ jobs:
with:
name: test-macos-trx
path: "**/*.trx"


test-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: Set up zlib-static
run: sudo apt-get install -y libkrb5-dev
- name: Run task 'pack'
run: ./build.cmd pack

spellcheck-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: "16"
node-version: "18"
- name: Install cSpell
run: npm install -g cspell
run: npm install -g cspell@8.0.0
- name: Copy cSpell config
run: cp ./build/cSpell.json ./cSpell.json
- name: Run cSpell
Expand Down
20 changes: 17 additions & 3 deletions BenchmarkDotNet.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
# Visual Studio Version 17
VisualStudioVersion = 17.8.34004.107
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D6597E3A-6892-4A68-8E14-042FC941FDA2}"
EndProject
Expand Down Expand Up @@ -47,7 +47,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Templates", "templates\BenchmarkDotNet.Templates.csproj", "{B620D10A-CD8E-4A34-8B27-FD6257E63AD0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkDotNet.Diagnostics.dotTrace", "src\BenchmarkDotNet.Diagnostics.dotTrace\BenchmarkDotNet.Diagnostics.dotTrace.csproj", "{C5BDA61F-3A56-4B59-901D-0A17E78F4076}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Diagnostics.dotTrace", "src\BenchmarkDotNet.Diagnostics.dotTrace\BenchmarkDotNet.Diagnostics.dotTrace.csproj", "{C5BDA61F-3A56-4B59-901D-0A17E78F4076}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks", "tests\BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks\BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj", "{AACA2C63-A85B-47AB-99FC-72C3FF408B14}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkDotNet.TestAdapter", "src\BenchmarkDotNet.TestAdapter\BenchmarkDotNet.TestAdapter.csproj", "{4C9C89B8-7C4E-4ECF-B3C9-324C8772EDAC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -131,6 +135,14 @@ Global
{C5BDA61F-3A56-4B59-901D-0A17E78F4076}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5BDA61F-3A56-4B59-901D-0A17E78F4076}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5BDA61F-3A56-4B59-901D-0A17E78F4076}.Release|Any CPU.Build.0 = Release|Any CPU
{AACA2C63-A85B-47AB-99FC-72C3FF408B14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AACA2C63-A85B-47AB-99FC-72C3FF408B14}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AACA2C63-A85B-47AB-99FC-72C3FF408B14}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AACA2C63-A85B-47AB-99FC-72C3FF408B14}.Release|Any CPU.Build.0 = Release|Any CPU
{4C9C89B8-7C4E-4ECF-B3C9-324C8772EDAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C9C89B8-7C4E-4ECF-B3C9-324C8772EDAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C9C89B8-7C4E-4ECF-B3C9-324C8772EDAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C9C89B8-7C4E-4ECF-B3C9-324C8772EDAC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -155,6 +167,8 @@ Global
{D9F5065B-6190-431B-850C-117E3D64AB33} = {D6597E3A-6892-4A68-8E14-042FC941FDA2}
{B620D10A-CD8E-4A34-8B27-FD6257E63AD0} = {63B94FD6-3F3D-4E04-9727-48E86AC4384C}
{C5BDA61F-3A56-4B59-901D-0A17E78F4076} = {D6597E3A-6892-4A68-8E14-042FC941FDA2}
{AACA2C63-A85B-47AB-99FC-72C3FF408B14} = {14195214-591A-45B7-851A-19D3BA2413F9}
{4C9C89B8-7C4E-4ECF-B3C9-324C8772EDAC} = {D6597E3A-6892-4A68-8E14-042FC941FDA2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4D9AF12B-1F7F-45A7-9E8C-E4E46ADCBD1F}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### The MIT License

Copyright (c) 2013–2023 .NET Foundation and contributors
Copyright (c) 2013–2024 .NET Foundation and contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
1 change: 1 addition & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
</packageSources>
</configuration>
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<div align="center">

[![NuGet](https://img.shields.io/nuget/v/BenchmarkDotNet.svg)](https://www.nuget.org/packages/BenchmarkDotNet/)
[![MyGet](https://img.shields.io/myget/benchmarkdotnet/vpre/benchmarkdotnet?label=myget)](https://www.myget.org/feed/Packages/benchmarkdotnet)
[![MyGet](https://img.shields.io/myget/benchmarkdotnet/vpre/benchmarkdotnet?label=myget)](https://www.myget.org/feed/benchmarkdotnet/package/nuget/BenchmarkDotNet)
[![Downloads](https://img.shields.io/nuget/dt/benchmarkdotnet.svg)](https://www.nuget.org/packages/BenchmarkDotNet/)
[![Stars](https://img.shields.io/github/stars/dotnet/BenchmarkDotNet?color=brightgreen)](https://github.com/dotnet/BenchmarkDotNet/stargazers)
![License](https://img.shields.io/badge/license-MIT-blue.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/dotnet/BenchmarkDotNet/blob/master/LICENSE.md)
[![Twitter](https://img.shields.io/twitter/follow/BenchmarkDotNet?style=social&label=Twitter)](https://twitter.com/BenchmarkDotNet)

</div>
Expand All @@ -30,7 +30,7 @@ It's no harder than writing unit tests!
Under the hood, it performs a lot of [magic](#automation) that guarantees [reliable and precise](#reliability) results thanks to the [perfolizer](https://github.com/AndreyAkinshin/perfolizer) statistical engine.
BenchmarkDotNet protects you from popular benchmarking mistakes and warns you if something is wrong with your benchmark design or obtained measurements.
The results are presented in a [user-friendly](#friendliness) form that highlights all the important facts about your experiment.
BenchmarkDotNet is already adopted by [16600+ GitHub projects](https://github.com/dotnet/BenchmarkDotNet/network/dependents) including
BenchmarkDotNet is already adopted by [19100+ GitHub projects](https://github.com/dotnet/BenchmarkDotNet/network/dependents) including
[.NET Runtime](https://github.com/dotnet/runtime),
[.NET Compiler](https://github.com/dotnet/roslyn),
[.NET Performance](https://github.com/dotnet/performance),
Expand Down Expand Up @@ -268,3 +268,13 @@ Let's build the best tool for benchmarking together!
This project has adopted the code of conduct defined by the [Contributor Covenant](https://www.contributor-covenant.org/)
to clarify expected behavior in our community.
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

## Sponsors

BenchmarkDotNet is supported by the [AWS Open Source Software Fund](https://github.com/aws/dotnet-foss).

<div align="center">

[![](https://gist.githubusercontent.com/AndreyAkinshin/f08c77960c064233348157215781b13b/raw/9d00f0ba4acb8861f9287de5d43b0ec60d7a55ac/aws-logo-small.png)](https://github.com/aws/dotnet-foss)

</div>
10 changes: 5 additions & 5 deletions build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
<PackageReference Include="Cake.Frosting" Version="4.0.0" />
<PackageReference Include="Cake.FileHelpers" Version="6.1.3" />
<PackageReference Include="Cake.Git" Version="3.0.0" />
<PackageReference Include="Microsoft.DocAsCode.App" Version="2.67.5" />
<PackageReference Include="Octokit" Version="7.0.0" />
<PackageReference Include="Docfx.App" Version="2.75.1" />
<PackageReference Include="Octokit" Version="9.1.0" />
</ItemGroup>
</Project>
</Project>
3 changes: 3 additions & 0 deletions build/BenchmarkDotNet.Build/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public BuildContext(ICakeContext context)
BuildDirectory = RootDirectory.Combine("build");
ArtifactsDirectory = RootDirectory.Combine("artifacts");

var toolFileName = context.IsRunningOnWindows() ? "dotnet.exe" : "dotnet";
var toolFilePath = RootDirectory.Combine(".dotnet").CombineWithFilePath(toolFileName);
context.Tools.RegisterFile(toolFilePath);

SolutionFile = RootDirectory.CombineWithFilePath("BenchmarkDotNet.sln");

Expand Down
7 changes: 5 additions & 2 deletions build/BenchmarkDotNet.Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class InTestsFullTask : FrostingTask<BuildContext>, IHelpProvider
public class InTestsCoreTask : FrostingTask<BuildContext>, IHelpProvider
{
private const string Name = "in-tests-core";
public override void Run(BuildContext context) => context.UnitTestRunner.RunInTests("net7.0");
public override void Run(BuildContext context) => context.UnitTestRunner.RunInTests("net8.0");
public HelpInfo GetHelp() => new();
}

Expand Down Expand Up @@ -222,7 +222,10 @@ public class ReleaseTask : FrostingTask<BuildContext>, IHelpProvider
{
new Example(Name)
.WithArgument(KnownOptions.Stable)
.WithArgument(KnownOptions.NextVersion, "v0.1.1729")
.WithArgument(KnownOptions.NextVersion, "0.1.1729")
.WithArgument(KnownOptions.Push),
new Example(Name)
.WithArgument(KnownOptions.Stable)
.WithArgument(KnownOptions.Push)
}
};
Expand Down
4 changes: 2 additions & 2 deletions build/BenchmarkDotNet.Build/Runners/DocumentationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ private void RunDocfx()

var currentDirectory = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(docfxJsonFile.GetDirectory().FullPath);
Microsoft.DocAsCode.Dotnet.DotnetApiCatalog.GenerateManagedReferenceYamlFiles(docfxJsonFile.FullPath).Wait();
Microsoft.DocAsCode.Docset.Build(docfxJsonFile.FullPath).Wait();
Docfx.Dotnet.DotnetApiCatalog.GenerateManagedReferenceYamlFiles(docfxJsonFile.FullPath).Wait();
Docfx.Docset.Build(docfxJsonFile.FullPath).Wait();
Directory.SetCurrentDirectory(currentDirectory);
}

Expand Down
12 changes: 9 additions & 3 deletions build/BenchmarkDotNet.Build/Runners/ReleaseRunner.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BenchmarkDotNet.Build.Helpers;
using BenchmarkDotNet.Build.Meta;
Expand Down Expand Up @@ -34,9 +33,15 @@ public void Run()
else
EnvVar.NuGetToken.SetEmpty();

var nextVersion = KnownOptions.NextVersion.AssertHasValue(context);
var currentVersion = context.VersionHistory.CurrentVersion;
var tag = "v" + currentVersion;
var nextVersion = KnownOptions.NextVersion.Resolve(context);
if (nextVersion == "")
{
var version = Version.Parse(currentVersion);
nextVersion = $"{version.Major}.{version.Minor}.{version.Build + 1}";
context.Information($"Evaluated NextVersion: {nextVersion}");
}

context.GitRunner.Tag(tag);

Expand Down Expand Up @@ -101,7 +106,7 @@ private void PushNupkg()
var nuGetToken = EnvVar.NuGetToken.GetValue();

var files = context
.GetFiles(context.ArtifactsDirectory.CombineWithFilePath("*").FullPath)
.GetFiles(context.ArtifactsDirectory.CombineWithFilePath("*.nupkg").FullPath)
.OrderBy(file => file.FullPath);
var settings = new DotNetNuGetPushSettings
{
Expand Down Expand Up @@ -138,6 +143,7 @@ private void PublishGitHubRelease()
Draft = false,
Prerelease = false,
GenerateReleaseNotes = false,
DiscussionCategoryName = "Announcements",
Body = notes
}).Wait();
context.Information(" Success");
Expand Down
4 changes: 2 additions & 2 deletions build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ private void RunTests(FilePath projectFile, string alias, string tfm)
public void RunUnitTests()
{
var targetFrameworks = context.IsRunningOnWindows()
? new[] { "net462", "net7.0" }
: new[] { "net7.0" };
? new[] { "net462", "net8.0" }
: new[] { "net8.0" };

foreach (var targetFramework in targetFrameworks)
RunUnitTests(targetFramework);
Expand Down
5 changes: 2 additions & 3 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ if (!(Test-Path $InstallPath)) {
$ScriptPath = Join-Path $InstallPath 'dotnet-install.ps1'
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, $ScriptPath);
& $ScriptPath -JSonFile $GlobalJsonPath -InstallDir $InstallPath;

Remove-PathVariable "$InstallPath"
$env:PATH = "$InstallPath;$env:PATH"
}

Remove-PathVariable "$InstallPath"
$env:PATH = "$InstallPath;$env:PATH"
$env:DOTNET_ROOT=$InstallPath

###########################################################################
Expand Down
1 change: 1 addition & 0 deletions build/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"Pseudocode",
"runtimes",
"Serilog",
"vstest",
"Tailcall",
"toolchains",
"unmanaged"
Expand Down
7 changes: 5 additions & 2 deletions build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
<UseSharedCompilation>false</UseSharedCompilation>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<SuppressNETCoreSdkPreviewMessage>True</SuppressNETCoreSdkPreviewMessage>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingStyle.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<Nullable>annotations</Nullable>
</PropertyGroup>

<ItemGroup>
Expand All @@ -33,11 +36,11 @@
</PropertyGroup>

<PropertyGroup Condition=" '$(IsVisualBasic)' != 'true' AND '$(IsFsharp)' != 'true' ">
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(VersionPrefix)' == '' ">
<VersionPrefix>0.13.7</VersionPrefix>
<VersionPrefix>0.13.13</VersionPrefix>
</PropertyGroup>

<PropertyGroup Condition=" '$(NoVersionSuffix)' == '' AND '$(VersionSuffix)' == '' ">
Expand Down
2 changes: 1 addition & 1 deletion build/sdk/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.305",
"version": "8.0.101",
"rollForward": "disable"
}
}
8 changes: 7 additions & 1 deletion build/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@
0.13.4
0.13.5
0.13.6
0.13.7
0.13.7
0.13.8
0.13.9
0.13.10
0.13.11
0.13.12
0.13.13
11 changes: 11 additions & 0 deletions docs/_changelog/footer/v0.13.10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_Date: November 01, 2023_

_Milestone: [v0.13.10](https://github.com/dotnet/BenchmarkDotNet/issues?q=milestone%3Av0.13.10)_
([List of commits](https://github.com/dotnet/BenchmarkDotNet/compare/v0.13.9...v0.13.10))

_NuGet Packages:_
* https://www.nuget.org/packages/BenchmarkDotNet/0.13.10
* https://www.nuget.org/packages/BenchmarkDotNet.Annotations/0.13.10
* https://www.nuget.org/packages/BenchmarkDotNet.Diagnostics.dotTrace/0.13.10
* https://www.nuget.org/packages/BenchmarkDotNet.Diagnostics.Windows/0.13.10
* https://www.nuget.org/packages/BenchmarkDotNet.Templates/0.13.10
Loading

0 comments on commit d602146

Please sign in to comment.