Sorry if this is a newbish question, but it was my understanding that benchmark tests should always be run with GCSettings.LatencyMode = GCLatencyMode.LowLatency, and/or using TryStartNoGCRegion(). I searched the repo but didn't see anything related to those in the code.
/cc @adamsitnik
@BlueRaja, @AndreyAkinshin well, this is not a best idea as it _may_ provide results that will differ from real-world results. I'm not speaking about nanobenchmarks but for larger ones GC settings will have influence on execution time.
See the Server GC vs. Workstation GC in a real application section as a proof.
It's very good question.
Our policy is not to change default GC settings to make sure that allocating benchmarks will include the extra time spent in GC. By doing this we make sure that our results are as close as possible to real life situation.
By default we perform memory cleanup before and after every iteration (set of invocations). This and few other things like Workstation/Server mode can be changed by using our GcMode settings. And if somebody wants to use some extra settings it's possible to do it inside Global/Iteration Setup and Cleanup methods. I am doing this on my own when I know what I want to get, like here
Fair enough. Thanks!
Most helpful comment
It's very good question.
Our policy is not to change default GC settings to make sure that allocating benchmarks will include the extra time spent in GC. By doing this we make sure that our results are as close as possible to real life situation.
By default we perform memory cleanup before and after every iteration (set of invocations). This and few other things like Workstation/Server mode can be changed by using our GcMode settings. And if somebody wants to use some extra settings it's possible to do it inside Global/Iteration Setup and Cleanup methods. I am doing this on my own when I know what I want to get, like here