Skip to content

Commit fe412ff

Browse files
committed
Merge branch 'master' into valuetask-nongeneric-inprocess
# Conflicts: # tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs
2 parents 4d6159c + 1fb1015 commit fe412ff

File tree

142 files changed

+4647
-625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+4647
-625
lines changed

.github/workflows/docs-stable.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: docs-stable
2+
3+
on:
4+
push:
5+
branches:
6+
- docs-stable
7+
workflow_dispatch:
8+
9+
permissions: write-all
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
steps:
15+
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
ref: docs-stable
20+
21+
- name: Build BenchmarkDotNet
22+
run: ./build.bat --target Build
23+
24+
# Temporary disabled because of the API limit
25+
# - name: Download changelog
26+
# run: ./build.bat --target DocFX_Changelog_Download --LatestVersions true --StableVersions true
27+
# env:
28+
# GITHUB_PRODUCT: ChangelogBuilder
29+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Build documentation
32+
run: ./build.bat --target DocFX_Build
33+
34+
- name: Upload Artifacts
35+
uses: actions/upload-artifact@v1
36+
with:
37+
name: site
38+
path: docs/_site
39+
40+
deploy:
41+
concurrency: ci-${{ github.ref }}
42+
needs: [build]
43+
runs-on: ubuntu-latest
44+
steps:
45+
46+
- name: Checkout
47+
uses: actions/checkout@v3
48+
with:
49+
ref: docs-stable
50+
51+
- name: Download Artifacts
52+
uses: actions/download-artifact@v1
53+
with:
54+
name: site
55+
56+
- name: Deploy documentation
57+
uses: JamesIves/[email protected]
58+
with:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
BRANCH: gh-pages
61+
FOLDER: site
62+
GIT_CONFIG_NAME: Andrey Akinshin
63+
GIT_CONFIG_EMAIL: [email protected]
64+
CLEAN: true

.github/workflows/spellcheck.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Documentation Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "docs/**/*"
9+
pull_request:
10+
branches:
11+
- master
12+
paths:
13+
- "docs/**/*"
14+
jobs:
15+
spellcheck:
16+
name: "Docs: Spellcheck"
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
name: Check out the code
21+
- uses: actions/setup-node@v1
22+
name: Setup node
23+
with:
24+
node-version: "16"
25+
- run: npm install -g cspell
26+
name: Install cSpell
27+
- run: cspell --config ./cSpell.json "docs/**/*.md" --no-progress
28+
name: Run cSpell

build/Program.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.IO;
23
using System.Linq;
34
using System.Text;
@@ -202,7 +203,7 @@ public void RunDocfx(FilePath docfxJson, string args = "")
202203

203204
public static class DocumentationHelper
204205
{
205-
public const string DocFxVersion = "2.59.3";
206+
public const string DocFxVersion = "2.59.4";
206207

207208
public static readonly string[] BdnAllVersions =
208209
{
@@ -428,12 +429,19 @@ public override void Run(BuildContext context)
428429
context.DocfxChangelogDownload(
429430
DocumentationHelper.BdnAllVersions[i],
430431
DocumentationHelper.BdnAllVersions[i - 1]);
432+
} else if (context.Argument("LatestVersions", false))
433+
{
434+
for (int i = DocumentationHelper.BdnAllVersions.Length - 2; i < DocumentationHelper.BdnAllVersions.Length; i++)
435+
context.DocfxChangelogDownload(
436+
DocumentationHelper.BdnAllVersions[i],
437+
DocumentationHelper.BdnAllVersions[i - 1]);
431438
}
432439

433-
context.DocfxChangelogDownload(
434-
DocumentationHelper.BdnNextVersion,
435-
DocumentationHelper.BdnAllVersions.Last(),
436-
"HEAD");
440+
if (!context.Argument("StableVersions", false))
441+
context.DocfxChangelogDownload(
442+
DocumentationHelper.BdnNextVersion,
443+
DocumentationHelper.BdnAllVersions.Last(),
444+
"HEAD");
437445
}
438446
}
439447

cSpell.json

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"words": [
5+
"Alloc",
6+
"analyse",
7+
"analyser",
8+
"Analysers",
9+
"Autofac",
10+
"bitness",
11+
"corlib",
12+
"Cygwin",
13+
"Diagnoser",
14+
"diagnosers",
15+
"disassemblers",
16+
"disassm",
17+
"Jits",
18+
"Jitting",
19+
"LINQ",
20+
"microbenchmarking",
21+
"microbenchmarks",
22+
"Mispredict",
23+
"Mispredictions",
24+
"msbuild",
25+
"Multimodal",
26+
"multimodality",
27+
"netcoreapp",
28+
"powerplans",
29+
"Pseudocode",
30+
"runtimes",
31+
"Serilog",
32+
"Tailcall",
33+
"toolchains",
34+
"unmanaged"
35+
],
36+
"ignoreWords": [
37+
"Akinshin",
38+
"Andrey",
39+
"Expecto",
40+
"Jint",
41+
"LoongArch64",
42+
"macrobenchmark",
43+
"MediatR",
44+
"Nagórski's",
45+
"Newtonsoft",
46+
"NodaTime",
47+
"Npgsql",
48+
"Sitnik's",
49+
"Wojciech",
50+
"Avalonia",
51+
"Gitter"
52+
],
53+
"patterns": [
54+
{
55+
"name": "Markdown links",
56+
"pattern": "\\((.*)\\)",
57+
"description": ""
58+
},
59+
{
60+
"name": "Markdown code blocks",
61+
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
62+
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
63+
},
64+
{
65+
"name": "Inline code blocks",
66+
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
67+
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
68+
},
69+
{
70+
"name": "Link contents",
71+
"pattern": "\\<a(.*)\\>",
72+
"description": ""
73+
},
74+
{
75+
"name": "Snippet references",
76+
"pattern": "-- snippet:(.*)",
77+
"description": ""
78+
},
79+
{
80+
"name": "Snippet references 2",
81+
"pattern": "\\<\\[sample:(.*)",
82+
"description": "another kind of snippet reference"
83+
},
84+
{
85+
"name": "Multi-line code blocks",
86+
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
87+
},
88+
{
89+
"name": "HTML Tags",
90+
"pattern": "<[^>]*>",
91+
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string"
92+
}
93+
],
94+
"ignoreRegExpList": [
95+
"Markdown links",
96+
"Markdown code blocks",
97+
"Inline code blocks",
98+
"Link contents",
99+
"Snippet references",
100+
"Snippet references 2",
101+
"Multi-line code blocks",
102+
"HTML Tags"
103+
],
104+
"ignorePaths": [
105+
"docs/_changelog/**/*.md",
106+
"docs/articles/team.md"
107+
]
108+
}

docs/_changelog/footer/v0.10.7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ _Date: June 05, 2017_
22

33
_Milestone: [v0.10.7](https://github.com/PerfDotNet/BenchmarkDotNet/issues?q=milestone%3Av0.10.7)_
44

5-
_Overview post: http://aakinshin.net/blog/post/bdn-v0_10_7/_
5+
_Overview post: https://aakinshin.net/posts/bdn-v0_10_7/_
66

77
_NuGet Packages:_
88
* https://www.nuget.org/packages/BenchmarkDotNet/0.10.7

docs/_changelog/header/v0.10.10.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Highlights:
22

3-
* Disassembly Diagnoser (read more here: [Disassembling .NET Code with BenchmarkDotNet](http://adamsitnik.com/Disassembly-Diagnoser/))
3+
* Disassembly Diagnoser (read more here: [Disassembling .NET Code with BenchmarkDotNet](https://adamsitnik.com/Disassembly-Diagnoser/))
44
* ParamsSources
55
* .NET Core x86 support
66
* Environment variables and Mono args support
77
* Better environment description
88
* More: additional sections in the documentation, bug fixes, build script improvements, internal refactoring.
99

10-
Overview post: [BenchmarkDotNet v0.10.10](http://aakinshin.net/blog/post/bdn-v0_10_10/)
10+
Overview post: [BenchmarkDotNet v0.10.10](https://aakinshin.net/posts/bdn-v0_10_10/)

docs/_changelog/header/v0.10.12.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Overview post: [BenchmarkDotNet v0.10.12](http://aakinshin.net/blog/post/bdn-v0_10_12/)
1+
Overview post: [BenchmarkDotNet v0.10.12](https://aakinshin.net/posts/bdn-v0_10_12/)
22

33
### Highlights
44

docs/_changelog/header/v0.10.13.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Overview post: [BenchmarkDotNet v0.10.13](http://aakinshin.net/blog/post/bdn-v0_10_13/)
1+
Overview post: [BenchmarkDotNet v0.10.13](https://aakinshin.net/posts/bdn-v0_10_13/)

docs/_changelog/header/v0.10.14.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* Per-method parameterization ([Read more](http://benchmarkdotnet.org/Advanced/Arguments.htm))
1+
* Per-method parameterization ([Read more](https://benchmarkdotnet.org/articles/features/parameterization.html))
22
* Console histograms and multimodal disribution detection
3-
* Many improvements for Mono disassembly support on Windows ([Read more](https://aakinshin.net/blog/post/dotnet-crossruntime-disasm/))
3+
* Many improvements for Mono disassembly support on Windows ([Read more](https://aakinshin.net/posts/dotnet-crossruntime-disasm/))
44
* Many bugfixes

docs/_changelog/header/v0.11.2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In this release, we have many improvements in different areas:
4545

4646
### EtwProfiler
4747

48-
`EtwProfiler` allows to profile the benchmarked .NET code on Windows and exports the data to a trace file which can be opened with [PerfView](https://github.com/Microsoft/perfview) or [Windows Performance Analyzer](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer).
48+
`EtwProfiler` allows to profile the benchmarked .NET code on Windows and exports the data to a trace file which can be opened with [PerfView](https://github.com/Microsoft/perfview) or [Windows Performance Analyzer](https://learn.microsoft.com/windows-hardware/test/wpt/windows-performance-analyzer).
4949

5050
`EtwProfiler` uses `TraceEvent` library which internally uses Event Tracing for Windows (ETW) to capture stack traces and important .NET Runtime events.
5151
Before the process with benchmarked code is started, EtwProfiler starts User and Kernel ETW sessions. Every session writes data to it's own file and captures different data. User session listens for the .NET Runtime events (GC, JIT etc) while the Kernel session gets CPU stacks and Hardware Counter events. After this, the process with benchmarked code is started. During the benchmark execution all the data is captured and written to a trace file. Moreover, BenchmarkDotNet Engine emits it's own events to be able to differentiate jitting, warmup, pilot and actual workload when analyzing the trace file. When the benchmarking is over, both sessions are closed and the two trace files are merged into one.
@@ -116,7 +116,7 @@ Now it's possible to run benchmarks on preview versions of .NET Core 3.0.
116116

117117
### Deferred Execution Validator
118118

119-
In LINQ, execution of a query is usually [deferred](https://blogs.msdn.microsoft.com/charlie/2007/12/10/linq-and-deferred-execution/) until the moment when you actually request the data. If your benchmark just returns `IEnumerable` or `IQueryable` it's not measuring the execution of the query, just the creation.
119+
In LINQ, execution of a query is usually [deferred](https://learn.microsoft.com/dotnet/standard/linq/deferred-execution-example) until the moment when you actually request the data. If your benchmark just returns `IEnumerable` or `IQueryable` it's not measuring the execution of the query, just the creation.
120120

121121
This is why we decided to warn you about this issue whenever it happens:
122122

docs/_changelog/header/v0.11.3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ This release is focused mainly on bug fixes that were affecting user experience.
2323

2424
### ConcurrencyVisualizerProfiler
2525

26-
`ConcurrencyVisualizerProfiler` allows to profile the benchmarked .NET code on Windows and exports the data to a CVTrace file which can be opened with [Concurrency Visualizer](https://docs.microsoft.com/en-us/visualstudio/profiling/concurrency-visualizer).
26+
`ConcurrencyVisualizerProfiler` allows to profile the benchmarked .NET code on Windows and exports the data to a CVTrace file which can be opened with [Concurrency Visualizer](https://learn.microsoft.com/visualstudio/profiling/concurrency-visualizer).
2727

28-
`ConcurrencyVisualizerProfiler` uses `EtwProfiler` to get a `.etl` file which still can be opened with [PerfView](https://github.com/Microsoft/perfview) or [Windows Performance Analyzer](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer). The difference is that it also enables all Task and Thread related ETW Providers and exports a simple `xml` which can be opened with Visual Studio if you install [Concurrency Visualizer plugin](https://marketplace.visualstudio.com/items?itemName=Diagnostics.ConcurrencyVisualizer2017)
28+
`ConcurrencyVisualizerProfiler` uses `EtwProfiler` to get a `.etl` file which still can be opened with [PerfView](https://github.com/Microsoft/perfview) or [Windows Performance Analyzer](https://learn.microsoft.com/windows-hardware/test/wpt/windows-performance-analyzer). The difference is that it also enables all Task and Thread related ETW Providers and exports a simple `xml` which can be opened with Visual Studio if you install [Concurrency Visualizer plugin](https://marketplace.visualstudio.com/items?itemName=Diagnostics.ConcurrencyVisualizer2017)
2929

3030
![open trace](https://user-images.githubusercontent.com/6011991/48638184-2b13fe00-e9d0-11e8-8a94-0e951e4606ae.png)
3131

docs/_changelog/header/v0.12.0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ Full .NET Framework always runs every .NET executable using the latest .NET Fram
216216
If you try to run the benchmarks for a few .NET TFMs, they are all going to be executed using the latest .NET Framework from your machine.
217217
The only difference is that they are all going to have different features enabled depending on the target version they were compiled for.
218218
You can read more about this
219-
[here](https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/version-compatibility) and
220-
[here](https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/application-compatibility).
219+
[here](https://learn.microsoft.com/dotnet/framework/migration-guide/version-compatibility) and
220+
[here](https://learn.microsoft.com/dotnet/framework/migration-guide/application-compatibility).
221221
This is **.NET Framework behavior which can not be controlled by BenchmarkDotNet or any other tool**.
222222

223223
**Note:** Console arguments support works only if you pass the `args` to `BenchmarkSwitcher`:
@@ -282,7 +282,7 @@ Moreover, if you share the source code of the benchmark, other people can run it
282282
## Official templates for BenchmarkDotNet-based projects
283283

284284
Since v0.12.0, BenchmarkDotNet provides project templates to setup your benchmarks easily.
285-
The template exists for each major .NET language ([C#](https://docs.microsoft.com/en-us/dotnet/csharp/), [F#](https://docs.microsoft.com/en-us/dotnet/fsharp/) and [VB](https://docs.microsoft.com/en-us/dotnet/visual-basic/)) with equivalent features and structure.
285+
The template exists for each major .NET language ([C#](https://learn.microsoft.com/dotnet/csharp/), [F#](https://learn.microsoft.com/dotnet/fsharp/) and [VB](https://learn.microsoft.com/dotnet/visual-basic/)) with equivalent features and structure.
286286
The templates require the [.NET Core SDK](https://www.microsoft.com/net/download). Once installed, run the following command to install the templates:
287287
288288
```log
@@ -352,7 +352,7 @@ dotnet new benchmark --help
352352

353353
The version of the template NuGet package is synced with the [BenchmarkDotNet](https://www.nuget.org/packages/BenchmarkDotNet/) package.
354354
For instance, the template version `0.12.0` is referencing [BenchmarkDotnet 0.12.0](https://www.nuget.org/packages/BenchmarkDotNet/0.12.0) - there is no floating version behavior.
355-
For more info about the `dotnet new` CLI, please read [the documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet).
355+
For more info about the `dotnet new` CLI, please read [the documentation](https://learn.microsoft.com/dotnet/core/tools/dotnet).
356356
357357
## New NativeMemoryProfiler
358358

docs/_changelog/header/v0.13.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ We are really excited to see the experimental CoreRT project grow and become off
5656
As every AOT solution, NativeAOT has some [limitations](https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/docs/limitations.md) like limited reflection support or lack of dynamic assembly loading. Because of that, the host process (what you run from command line) is never an AOT process, but just a regular .NET process. This process (called Host process) uses reflection to read benchmarks metadata (find all `[Benchmark]` methods etc.), generates a new project that references the benchmarks and compiles it using ILCompiler. The boilerplate code is not using reflection, so the project is built with `TrimmerDefaultAction=link` (we have greatly reduced build time thanks to that). Such compilation produces a native executable, which is later started by the Host process. This process (called Benchmark or Child process) performs the actual benchmarking and reports the results back to the Host process. By default BenchmarkDotNet uses the latest version of `Microsoft.DotNet.ILCompiler` to build the NativeAOT benchmark according to [this instructions](https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/docs/compiling.md). Moreover, BenchmarkDotNet by default uses current machines CPU features (change: [#1994](https://github.com/dotnet/BenchmarkDotNet/pull/1994), discussion: [#2061](https://github.com/dotnet/BenchmarkDotNet/issues/2061)) and if you don't like this behavior, you can [disable it](https://github.com/dotnet/BenchmarkDotNet/issues/2061#issuecomment-1203602177).
5757

5858
This is why you need to:
59-
- install [pre-requisites](https://docs.microsoft.com/en-us/dotnet/core/deploying/native-aot/#prerequisites) required by NativeAOT compiler
59+
- install [pre-requisites](https://learn.microsoft.com/dotnet/core/deploying/native-aot/#prerequisites) required by NativeAOT compiler
6060
- target .NET to be able to run NativeAOT benchmarks (example: `<TargetFramework>net7.0</TargetFramework>` in the .csproj file)
6161
- run the app as a .NET process (example: `dotnet run -c Release -f net7.0`).
6262
- specify the NativeAOT runtime in an explicit way, either by using console line arguments `--runtimes nativeaot7.0` (the recommended approach), or by using`[SimpleJob]` attribute or by using the fluent Job config API `Job.ShortRun.With(NativeAotRuntime.Net70)`:

docs/articles/configs/configoptions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
#cspell:ignore configoptions
23
uid: docs.configoptions
34
name: Configoptions
45
---

0 commit comments

Comments
 (0)