Click or drag to resize

JobsUtilitiesGetOptimalBatchCountForProcessorCount Method

Determines how to distribute a job based on the desired minimum items to run per job and logical cpu cores available to the .NET runtime.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static int GetOptimalBatchCountForProcessorCount(
	int arraySize,
	int desiredMinimumInBatch = 16
)

Parameters

arraySize
Type: SystemInt32
The total number of items that need to be worked on in the job (usually the size of the NativeArray).
desiredMinimumInBatch (Optional)
Type: SystemInt32
Because we don't really know what sort of work is being done, you can optionally pass in the minimum number of items per batch. Defaults to 16.

Return Value

Type: Int32
The number of items per batch for a nice (mostly) even distribution of items for the job.
See Also