Skip to content
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
5 changes: 2 additions & 3 deletions docs/articles/samples/IntroInProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ uid: BenchmarkDotNet.Samples.IntroInProcess

## Sample: IntroInProcess

InProcessToolchain is our toolchain which does not generate any new executable.
InProcessEmitToolchain is our toolchain which does not generate any new executable.
It emits IL on the fly and runs it from within the process itself.
It can be usefull if want to run the benchmarks very fast or
if you want to run them for framework which we don't support.
It can be usefull if want to run the benchmarks very fast or if you want to run them for framework which we don't support.
An example could be a local build of CoreCLR.

### Usage
Expand Down
4 changes: 2 additions & 2 deletions samples/BenchmarkDotNet.Samples/IntroInProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Order;
using BenchmarkDotNet.Toolchains.InProcess;
using BenchmarkDotNet.Toolchains.InProcess.Emit;

namespace BenchmarkDotNet.Samples
{
Expand All @@ -22,7 +22,7 @@ public Config()

Add(Job.MediumRun
.WithLaunchCount(1)
.With(InProcessToolchain.Instance)
.With(InProcessEmitToolchain.Instance)
.WithId("InProcess"));
}
}
Expand Down
3 changes: 2 additions & 1 deletion samples/BenchmarkDotNet.Samples/IntroInProcessWrongEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Order;
using BenchmarkDotNet.Toolchains.InProcess;
using BenchmarkDotNet.Toolchains.InProcess.Emit;

namespace BenchmarkDotNet.Samples
{
Expand All @@ -25,7 +26,7 @@ public Config()
Add(Job.MediumRun
.WithLaunchCount(1)
.With(wrongPlatform)
.With(InProcessToolchain.Instance)
.With(InProcessEmitToolchain.Instance)
.WithId("InProcess"));

Add(InProcessValidator.DontFailOnError);
Expand Down
3 changes: 2 additions & 1 deletion src/BenchmarkDotNet.Diagnostics.Windows/HardwareCounters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Portability;
using BenchmarkDotNet.Toolchains.InProcess;
using BenchmarkDotNet.Toolchains.InProcess.Emit;
using BenchmarkDotNet.Validators;
using Microsoft.Diagnostics.Tracing.Session;

Expand Down Expand Up @@ -61,7 +62,7 @@ public static IEnumerable<ValidationError> Validate(ValidationParameters validat
foreach (var benchmark in validationParameters.Benchmarks)
{
if (benchmark.Job.Infrastructure.HasValue(InfrastructureMode.ToolchainCharacteristic)
&& benchmark.Job.Infrastructure.Toolchain is InProcessToolchain)
&& (benchmark.Job.Infrastructure.Toolchain is InProcessToolchain || benchmark.Job.Infrastructure.Toolchain is InProcessEmitToolchain))
{
yield return new ValidationError(true, "Hardware Counters are not supported for InProcessToolchain.", benchmark);
}
Expand Down
6 changes: 3 additions & 3 deletions src/BenchmarkDotNet/Jobs/InfrastructureMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Horology;
using BenchmarkDotNet.Toolchains;
using BenchmarkDotNet.Toolchains.InProcess;
using BenchmarkDotNet.Toolchains.InProcess.Emit;

namespace BenchmarkDotNet.Jobs
{
Expand All @@ -20,8 +20,8 @@ public sealed class InfrastructureMode : JobMode<InfrastructureMode>
public static readonly Characteristic<IReadOnlyList<Argument>> ArgumentsCharacteristic = CreateCharacteristic<IReadOnlyList<Argument>>(nameof(Arguments));
public static readonly Characteristic<IReadOnlyCollection<NuGetReference>> NuGetReferencesCharacteristic = CreateCharacteristic<IReadOnlyCollection<NuGetReference>>(nameof(NuGetReferences));

public static readonly InfrastructureMode InProcess = new InfrastructureMode(InProcessToolchain.Instance);
public static readonly InfrastructureMode InProcessDontLogOutput = new InfrastructureMode(InProcessToolchain.DontLogOutput);
public static readonly InfrastructureMode InProcess = new InfrastructureMode(InProcessEmitToolchain.Instance);
public static readonly InfrastructureMode InProcessDontLogOutput = new InfrastructureMode(InProcessEmitToolchain.DontLogOutput);

public InfrastructureMode() { }

Expand Down