ParallelPerformanceTracker

public sealed class ParallelPerformanceTracker
A utility class for tracking performance under various degrees of parallelism.

Constructors

ParallelPerformanceTracker

#
public ParallelPerformanceTracker()
Create a tracker with a default action.

ParallelPerformanceTracker

#
public ParallelPerformanceTracker(Action<int> action)
action (Action<int>)

Properties

Action

#
public Action<int> Action { get; }
Gets the action to invoke on every iteration.

Methods

Measure

#
public (int degree, TimeSpan duration)[] Measure(int iterations, int minDegree, int maxDegree)
Measure performance across a range of degrees of parallelism.
iterations (int)
minDegree (int)
maxDegree (int)

Measure

#
public TimeSpan Measure(int iterations, int degree, CancellationToken token)
Compute a specific degree measurement asynchronously. Running this method more than one at the same time will taint the measurements, so be sure to await every call to this method.
iterations (int)
degree (int)
token (CancellationToken)