Skip to content

Commit

Permalink
Removed enable monitoring in engine (GcStats handles it).
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell committed Apr 15, 2024
1 parent 07c4054 commit d351f0e
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/BenchmarkDotNet/Engines/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,6 @@ private ClockSpan Measure(Action<long> action, long invokeCount)
[MethodImpl(CodeGenHelper.AggressiveOptimizationOption)]
private (GcStats, ThreadingStats, double) GetExtraStats(IterationData data)
{
// we enable monitoring after main target run, for this single iteration which is executed at the end
// so even if we enable AppDomain monitoring in separate process
// it does not matter, because we have already obtained the results!
EnableMonitoring();

// Warm up the GetAllocatedBytes function before starting the actual measurement.
DeadCodeEliminationHelper.KeepAliveWithoutBoxing(GcStats.ReadInitial());

Expand Down Expand Up @@ -285,15 +280,6 @@ internal static void ForceGcCollect()

public void WriteLine() => Host.WriteLine();

private static void EnableMonitoring()
{
if (RuntimeInformation.IsOldMono) // Monitoring is not available in Mono, see http://stackoverflow.com/questions/40234948/how-to-get-the-number-of-allocated-bytes-in-mono
return;

if (RuntimeInformation.IsFullFramework)
AppDomain.MonitoringIsEnabled = true;
}

[UsedImplicitly]
public static class Signals
{
Expand Down

0 comments on commit d351f0e

Please sign in to comment.