Skip to content

Commit

Permalink
Fix Fsharp template
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Byrd committed Jul 8, 2019
1 parent 79a4aed commit d936241
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<tags>benchmark;benchmarking;performance;template</tags>
<iconUrl>https://raw.githubusercontent.com/dotnet/BenchmarkDotNet/master/docs/guide/logo.png</iconUrl>
<projectUrl>https://benchmarkdotnet.org</projectUrl>
<license type="expression">MIT</license>
<repository type="git" url="https://github.com/dotnet/BenchmarkDotNet" ></repository>
<packageTypes>
<packageType name="Template" />
Expand Down
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>

0 comments on commit d936241

Please sign in to comment.