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
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
open BenchmarkDotNet.Analysers;
open BenchmarkDotNet.Attributes;
open BenchmarkDotNet.Columns;
open BenchmarkDotNet.Configs;
open BenchmarkDotNet.Exporters;
open BenchmarkDotNet.Exporters.Csv;
open BenchmarkDotNet.Jobs;
open BenchmarkDotNet.Loggers;
module Configs

open BenchmarkDotNet.Configs
open BenchmarkDotNet.Diagnosers
open BenchmarkDotNet.Exporters
open BenchmarkDotNet.Validators

type BenchmarkConfig() as self =

type BenchmarkConfig() =
// Configure your benchmarks, see for more details: https://benchmarkdotnet.org/articles/configs/configs.html.
ManualConfig
.Create(DefaultConfig.Instance)
.With(Job.ShortRun.With(Runtime.Mono))
.With(Job.ShortRun.With(Runtime.Core))
inherit ManualConfig()
do
self
.With(MemoryDiagnoser.Default)
.With(MarkdownExporter.GitHub)
.With(ExecutionValidator.FailOnError)
inherit ManualConfig()
new() = BenchmarkConfig()
|> ignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
open System;
open BenchmarkDotNet;
open BenchmarkDotNet.Attributes;
module Benchmark

open System
open BenchmarkDotNet
open BenchmarkDotNet.Attributes

#if config
[<Config(typeof(BenchmarkConfig))>]
[<Config(typedefof<Configs.BenchmarkConfig>)>]
#endif
type $(BenchmarkName) () =
[<Params(0, 1, 15, 100)>]
Expand Down Expand Up @@ -36,3 +38,5 @@ type $(BenchmarkName) () =

[<Benchmark>]
member this.AsyncToSync () = Async.Sleep(this.sleepTime) |> Async.RunSynchronously


Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
<PackageReference Include="BenchmarkDotNet" Version="0.1*" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.1*" />
</ItemGroup>
<ItemGroup Condition="'$(config)' == true">
<Compile Include="BenchmarkConfig.fs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(BenchmarkName).fs" />
</ItemGroup>
</Project>