Search Unity

Performance overhead of DOTS systems

Discussion in 'Entity Component System' started by maxxa05, Sep 27, 2019.

  1. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    SystemBase doesn't automatically synchronize before entering OnUpdate. Synchronization happens when:
    a) structural changes occur (AddComponent / Instantiate etc)
    b) SystemBase.GetComponent / SystemBase.SetComponent on the main thread
    c) Entities.ForEach.Run


    When using Entities.ForEach.Schedule happens there is no sync point. This means that it is unnecessary to declare [AlwaysSynchronizeSystem] because it is implied in the used operations. This makes it much easier to switch multithreaded and main thread code. This is very important during debugging & development, sometimes you don't start out writing multithreaded code, but just want to experiment and then slowly build up to multithreaded code.