QueryJob.MinParallelChunkLength.md
February 25, 2024 ยท View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS.QueryJob
QueryJob.MinParallelChunkLength Property
The minimum number of Chunk<T> components per thread required to execute a query Parallel.
Default: 1000.
public int MinParallelChunkLength { get; set; }
Property Value
Remarks
Parallel query execution adds an overhead of 1 to 2 micro seconds per query for thread synchronization.
Execution of a simple computation like health.value++ on a single component takes 0.5 to 1 nano seconds.
E.g. processing a chunk with 100 components will take 50 to 100 nano seconds.
So the chunk components are executed Sequential to avoid the parallelization overhead.
For more complex computations MinParallelChunkLength can be reduced to execute a query
Parallel when dealing with a lower number of components.