Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Performance of entities with managed components

Discussion in 'Entity Component System' started by maxxa05, Feb 22, 2020.

  1. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    I know that managed components have performance issues vs structs when used in systems (no burst, no jobs, etc). But if I store a managed components on entities that I rarely use, is there an sizeable impact on other unrelated stuff? For example, is there an impact on add/remove struct components on entities containing managed components? More GC allocations? Something else I did not mention maybe?
     
  2. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    I made some tests, and there is indeed a performance hit if you add/remove component on an entity that has a managed component. Something like 0.008ms vs 0.002ms, so nothing major. But still, if you need to do a lot of those on some entities, you may want to keep that in mind.