-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathProgram.cs
35 lines (27 loc) · 856 Bytes
/
Program.cs
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
33
34
// Made by Benjamin Abt - https://github.com/BenjaminAbt
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<Benchmark>();
[MemoryDiagnoser]
[SimpleJob(RuntimeMoniker.Net70)] // PGO enabled by default
[SimpleJob(RuntimeMoniker.Net80)]
[SimpleJob(RuntimeMoniker.Net90, baseline: true)]
[HideColumns(Column.Job)]
public class Benchmark
{
private const string _chars = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
[Benchmark]
public string ToUpper()
=> _chars.ToUpper();
[Benchmark]
public string ToUpperInvariant()
=> _chars.ToUpperInvariant();
[Benchmark]
public string ToLower()
=> _chars.ToLower();
[Benchmark]
public string ToLowerInvariant()
=> _chars.ToLowerInvariant();
}