BenchmarkAttribute
should be sealed
or the GetCustomAttributes
call should allow inheritance. The combination we have right now I consider to be a bug. Obviously, changing the call instead of sealing the attribute would be a better fix.
PerfDotNet only does throughput and micro-benchmarking, which is super helpful unto itself and it excels at doing that. But I needed to be able to also make assertions against Memory consumption and GC, so it didn't cover the spectrum of needs there. Plus I wanted unit test-style pass/fail semantics, which it also does not do.
develop
branch for your commits. I want to keep the master
branch and the NuGet package relevant.
It is cheaper to add unit testing for BenchmarkDotNet instead of implementing another full-featured benchmarking library.
Yeah good point, I guess we just add what we can to BenchmarkDotNet and see what happens. It's already getting pretty good traction in the CoreCLR/CoreFX GitHub issues.
By the way, right now I am implementing new algorithms that will choose wise amount of iteration. It will allow to run benchmarks really quickly and still have good accuracy. I'm almost finished, but such things takes a lot of time for testing.
That's cool, it'll stop things like this happening! https://twitter.com/ben_a_adams/status/678447298142199808
module BDNetFSharp.Program
open BenchmarkDotNet
open System.Reflection
type ArrayVsList () =
[<Params (10, 100)>]
member val public ColSize = 0 with get, set
[<Benchmark>]
member self.GetSquareArray () =
let value = self.ColSize / 2 in [| for _ in 0 .. self.ColSize -> value |].[value]
[<Benchmark>]
member self.GetSquareList () =
let value = self.ColSize / 2 in [for _ in 0 .. self.ColSize -> value ].[value]
let [<EntryPoint>] main args =
let competitionSwitch =
Assembly.GetExecutingAssembly().GetTypes()
|> Array.filter (fun t ->
t.GetMethods (BindingFlags.Instance ||| BindingFlags.Public )
|> Array.exists (fun m -> m.GetCustomAttributes (typeof<BenchmarkAttribute>, false) <> [||]))
|> BenchmarkSwitcher
competitionSwitch.Run args
0
Baseline
feature. Do you want to commit something before publishing?
BenchmarkStatResultExtenderTests
and spoil BaselineDeltaResultExtenderTest
, PerformanceUnitTest
, see diff with parent 140deccc.