-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathIntroEnvVars.cs
More file actions
32 lines (30 loc) · 969 Bytes
/
IntroEnvVars.cs
File metadata and controls
32 lines (30 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs;
namespace BenchmarkDotNet.Samples
{
[Config(typeof(ConfigWithCustomEnvVars))]
[UseLocalJobOnly]
public class IntroEnvVars
{
private class ConfigWithCustomEnvVars : ManualConfig
{
public ConfigWithCustomEnvVars()
{
AddJob(Job.Default.WithRuntime(CoreRuntime.Core80).WithId("Inlining enabled"));
AddJob(Job.Default.WithRuntime(CoreRuntime.Core80)
.WithEnvironmentVariables([
new EnvironmentVariable("DOTNET_JitNoInline", "1"),
new EnvironmentVariable("COMPlus_JitNoInline", "1")
])
.WithId("Inlining disabled"));
}
}
[Benchmark]
public void Foo()
{
// Benchmark body
}
}
}