-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.fs
50 lines (40 loc) · 1.56 KB
/
Program.fs
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// This file was created manually and its version is 1.0.0.
// This file supports running the performance benchmarks. Do not modify it.
open System.Collections.Generic
open System.Linq
open BenchmarkDotNet.Columns
open BenchmarkDotNet.Configs
open BenchmarkDotNet.Diagnosers
open BenchmarkDotNet.Loggers
open BenchmarkDotNet.Reports
open BenchmarkDotNet.Running
open TreeBuildingBenchmark
type BenchmarkConfig() =
inherit ManualConfig()
let distinctWithComparer (comparer: IEqualityComparer<'T>) (sequence: 'T seq) =
sequence.Distinct(comparer)
let columnProvider =
{
new IColumnProvider with
member __.GetColumns(summary: Summary) =
seq {
yield TargetMethodColumn.Method
yield StatisticColumn.Mean
yield!
summary.Reports
|> Seq.collect (fun r ->
r.Metrics.Values
|> Seq.filter (fun m -> m.Descriptor.DisplayName = "Allocated")
|> Seq.map (fun m -> m.Descriptor))
|> distinctWithComparer MetricDescriptorEqualityComparer.Instance
|> Seq.map (fun d -> MetricColumn d :> IColumn)
}
}
do
base.Add(columnProvider)
base.Add(MemoryDiagnoser.Default)
base.Add(new ConsoleLogger());
[<EntryPoint>]
let main _ =
BenchmarkRunner.Run<Benchmarks>(BenchmarkConfig()) |> ignore
0