This Is A Visual Studio Template For Benchmarking Using Benchmark.Net.
Just Clone This Repo And Add It To Your Vs
-
Do Not Run Your Benchmarks On Debug-mode/ Debugger-Attached.
-
Dot Not Use Static Methods For Benchmarking.
-
You Can Use
[MemoryDiagnoser]
Attribute On Top Of Your Class To See Memory Status For Benchmark, -
- You Can Also Pass
True
If You Wish To See Gc Column's OrFalse
To Ignore them.
- You Can Also Pass
-
[Benchmark]
Attribute Is Required in Top of The Methods That You Want To Benchmark It. -
You Methods Can Be
void
. -
Always Create Separated Class For Benchmark In Order To Pass it Down To
BenchmarkRunner.Run<MyClass>()