docs.unity3d.com
    Show / Hide Table of Contents

    Enum ScheduleGranularity

    Describes how the entities that match an EntityQuery should be distributed when a job is scheduled to run on multiple worker threads using ScheduleParallel(). In most cases, Chunk should be used.

    Namespace: Unity.Entities
    Syntax
    public enum ScheduleGranularity

    Fields

    Name Description Value
    Chunk

    Entities are distributed to worker threads at the granularity of entire chunks. This is generally the safest and highest-performance approach, and is the default mode unless otherwise specified. The entities within the chunk can be processed in a a cache-friendly manner, and job queue contention is minimized.

    Entity

    Entities are distributed to worker threads individually. This increases scheduling overhead and eliminates the cache-friendly benefits of chunk-level processing. However, it can lead to better load-balancing in cases where the number of entities being processed is relatively low, and the cost of processing each entity is high, as it allows the entities within a chunk to be distributed evenly across available worker threads.

    Extension Methods

    SourceGenHelpers.GetFlags()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023