You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run your benchmarks without specifying any custom settings, BenchmarkDotNet is going to run the benchmarks **using the same framework as the host process**:
25
25
26
26
```cmd
27
-
dotnet run -c Release -f netcoreapp2.1 # is going to run the benchmarks using .NET Core 2.1
28
-
dotnet run -c Release -f netcoreapp3.0 # is going to run the benchmarks using .NET Core 3.0
27
+
dotnet run -c Release -f netcoreapp3.1 # is going to run the benchmarks using .NET Core 3.1
28
+
dotnet run -c Release -f net8.0 # is going to run the benchmarks using .NET 8.0
29
29
dotnet run -c Release -f net48 # is going to run the benchmarks using .NET 4.8
30
30
mono $pathToExe # is going to run the benchmarks using Mono from your PATH
31
31
```
32
32
33
33
To run the benchmarks for multiple runtimes with a single command, you need to specify the target framework moniker names via `--runtimes|-r` console argument:
34
34
35
35
```cmd
36
-
dotnet run -c Release -f netcoreapp2.1 --runtimes netcoreapp2.1 netcoreapp3.0 # is going to run the benchmarks using .NET Core 2.1 and .NET Core 3.0
37
-
dotnet run -c Release -f netcoreapp2.1 --runtimes netcoreapp2.1 net48 # is going to run the benchmarks using .NET Core 2.1 and .NET 4.8
36
+
dotnet run -c Release -f net8.0 --runtimes net8.0 netcoreapp3.1 # is going to run the benchmarks using .NET 8.0 and .NET Core 3.1
37
+
dotnet run -c Release -f net8.0 --runtimes net8.0 net48 # is going to run the benchmarks using .NET 8.0 and .NET 4.8
38
38
```
39
39
40
40
What is going to happen if you provide multiple Full .NET Framework monikers? Let's say:
Copy file name to clipboardexpand all lines: docs/articles/guides/console-args.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -117,29 +117,29 @@ You can also filter the benchmarks by categories:
117
117
The `--runtimes` or just `-r` allows you to run the benchmarks for selected Runtimes. Available options are:
118
118
119
119
* Clr - BDN will either use Roslyn (if you run it as .NET app) or latest installed .NET SDK to build the benchmarks (if you run it as .NET Core app).
120
-
* Core - if you run it as .NET Core app, BDN will use the same target framework moniker, if you run it as .NET app it's going to use netcoreapp2.1.
120
+
* Core - if you run it as .NET Core app, BDN will use the same target framework moniker, if you run it as .NET app it's going to use net8.0.
121
121
* Mono - it's going to use the Mono from `$Path`, you can override it with `--monoPath`.
122
122
* net46, net461, net462, net47, net471, net472, net48, net481 - to build and run benchmarks against specific .NET Framework version.
123
-
*netcoreapp2.0, netcoreapp2.1, netcoreapp2.2, netcoreapp3.0, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net9.0 - to build and run benchmarks against specific .NET (Core) version.
123
+
* netcoreapp3.1, net5.0, net6.0, net7.0, net8.0 - to build and run benchmarks against specific .NET (Core) version.
124
124
* nativeaot5.0, nativeaot6.0, nativeaot7.0, nativeaot8.0 - to build and run benchmarks using NativeAOT. Can be customized with additional options: `--ilcPackages`, `--ilCompilerVersion`.
125
125
* mono6.0, mono7.0, mono8.0 - to build and run benchmarks with .Net 6+ using MonoVM.
126
126
127
-
Example: run the benchmarks for .NET 4.7.2 and .NET Core 2.1:
127
+
Example: run the benchmarks for .NET 4.7.2 and .NET 8.0:
128
128
129
129
```log
130
-
dotnet run -c Release -- --runtimes net472 netcoreapp2.1
130
+
dotnet run -c Release -- --runtimes net472 net8.0
131
131
```
132
132
133
-
Example: run the benchmarks for .NET Core 3.0 and latest .NET SDK installed on your PC:
133
+
Example: run the benchmarks for .NET Core 3.1 and latest .NET SDK installed on your PC:
134
134
135
135
```log
136
-
dotnet run -c Release -f netcoreapp3.0 -- --runtimes clr core
136
+
dotnet run -c Release -f netcoreapp3.1 -- --runtimes clr core
137
137
```
138
138
139
-
But same command executed with `-f netcoreapp2.0` is going to run the benchmarks for .NET Core 2.0:
139
+
But same command executed with `-f net6.0` is going to run the benchmarks for .NET 6.0:
140
140
141
141
```log
142
-
dotnet run -c Release -f netcoreapp2.0 -- --runtimes clr core
142
+
dotnet run -c Release -f net6.0 -- --runtimes clr core
143
143
```
144
144
145
145
## Number of invocations and iterations
@@ -208,10 +208,10 @@ To perform a Mann–Whitney U Test and display the results in a dedicated column
208
208
209
209
*`--statisticalTest`- Threshold for Mann–Whitney U Test. Examples: 5%, 10ms, 100ns, 1s
210
210
211
-
Example: run Mann–Whitney U test with relative ratio of 5% for all benchmarks for .NET Core 2.0 (base) vs .NET Core 2.1 (diff). .NET Core 2.0 will be baseline because it was first.
211
+
Example: run Mann–Whitney U test with relative ratio of 5% for all benchmarks for .NET 6.0 (base) vs .NET 8.0 (diff). .NET 6.0 will be baseline because it was first.
Copy file name to clipboardexpand all lines: src/BenchmarkDotNet/ConsoleArguments/CommandLineOptions.cs
+4-4
Original file line number
Diff line number
Diff line change
@@ -237,8 +237,8 @@ public static IEnumerable<Example> Examples
237
237
238
238
yieldreturnnewExample("Use Job.ShortRun for running the benchmarks",shortName,newCommandLineOptions{BaseJob="short"});
239
239
yieldreturnnewExample("Run benchmarks in process",shortName,newCommandLineOptions{RunInProcess=true});
240
-
yieldreturnnewExample("Run benchmarks for .NET 4.7.2, .NET Core 2.1 and Mono. .NET 4.7.2 will be baseline because it was first.",longName,newCommandLineOptions{Runtimes=new[]{"net472","netcoreapp2.1","Mono"}});
241
-
yieldreturnnewExample("Run benchmarks for .NET Core 2.0, .NET Core 2.1 and .NET Core 2.2. .NET Core 2.0 will be baseline because it was first.",longName,newCommandLineOptions{Runtimes=new[]{"netcoreapp2.0","netcoreapp2.1","netcoreapp2.2"}});
240
+
yieldreturnnewExample("Run benchmarks for .NET 4.7.2, .NET 8.0 and Mono. .NET 4.7.2 will be baseline because it was first.",longName,newCommandLineOptions{Runtimes=new[]{"net472","net8.0","Mono"}});
241
+
yieldreturnnewExample("Run benchmarks for .NET Core 3.1, .NET 6.0 and .NET 8.0. .NET Core 3.1 will be baseline because it was first.",longName,newCommandLineOptions{Runtimes=new[]{"netcoreapp3.1","net6.0","net8.0"}});
242
242
yieldreturnnewExample("Use MemoryDiagnoser to get GC stats",shortName,newCommandLineOptions{UseMemoryDiagnoser=true});
243
243
yieldreturnnewExample("Use DisassemblyDiagnoser to get disassembly",shortName,newCommandLineOptions{UseDisassemblyDiagnoser=true});
244
244
yieldreturnnewExample("Use HardwareCountersDiagnoser to get hardware counter info",longName,newCommandLineOptions{HardwareCounters=new[]{nameof(HardwareCounter.CacheMisses),nameof(HardwareCounter.InstructionRetired)}});
@@ -250,8 +250,8 @@ public static IEnumerable<Example> Examples
250
250
yieldreturnnewExample("Run selected benchmarks once per iteration",longName,newCommandLineOptions{RunOncePerIteration=true});
251
251
yieldreturnnewExample("Run selected benchmarks 100 times per iteration. Perform single warmup iteration and 5 actual workload iterations",longName,newCommandLineOptions{InvocationCount=100,WarmupIterationCount=1,IterationCount=5});
252
252
yieldreturnnewExample("Run selected benchmarks 250ms per iteration. Perform from 9 to 15 iterations",longName,newCommandLineOptions{IterationTimeInMilliseconds=250,MinIterationCount=9,MaxIterationCount=15});
253
-
yieldreturnnewExample("Run MannWhitney test with relative ratio of 5% for all benchmarks for .NET Core 2.0 (base) vs .NET Core 2.1 (diff). .NET Core 2.0 will be baseline because it was provided as first.",longName,
yieldreturnnewExample("Run MannWhitney test with relative ratio of 5% for all benchmarks for .NET 6.0 (base) vs .NET 8.0 (diff). .NET Core 6.0 will be baseline because it was provided as first.",longName,
yieldreturnnewExample("Run benchmarks using environment variables 'ENV_VAR_KEY_1' with value 'value_1' and 'ENV_VAR_KEY_2' with value 'value_2'",longName,
yieldreturnnewExample("Hide Mean and Ratio columns (use double quotes for multi-word columns: \"Alloc Ratio\")",shortName,newCommandLineOptions{HiddenColumns=new[]{"Mean","Ratio"},});
Copy file name to clipboardexpand all lines: src/BenchmarkDotNet/Toolchains/CoreRun/CoreRunToolchain.cs
+2-2
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,12 @@ public class CoreRunToolchain : IToolchain
15
15
/// </summary>
16
16
/// <param name="coreRun">the path to CoreRun</param>
17
17
/// /<param name="createCopy">should a copy of CoreRun be performed? True by default. <remarks>The toolchain replaces old dependencies in CoreRun folder with newer versions if used by the benchmarks.</remarks></param>
18
-
/// <param name="targetFrameworkMoniker">TFM, netcoreapp2.1 is the default</param>
18
+
/// <param name="targetFrameworkMoniker">TFM, net8.0 is the default</param>
19
19
/// <param name="customDotNetCliPath">path to dotnet cli, if not provided the one from PATH will be used</param>
20
20
/// <param name="displayName">display name, CoreRun is the default value</param>
21
21
/// <param name="restorePath">the directory to restore packages to</param>
<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> <!-- workaround for 'This runtime may not be supported by.NET Core.' error -->
144
144
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> <!-- workaround for 'Found multiple publish output files with the same relative path.' error -->
0 commit comments