Search Unity

Are MonoBehaviours slow?

Discussion in 'Scripting' started by Ologon, Mar 14, 2016.

  1. Ologon

    Ologon

    Joined:
    Nov 16, 2014
    Posts:
    16
    Can adding many monobehaviour components to the game objects in the scene have a noticeable impact on performance?

    For example, I will probably have 100 objects in the scene with a couple of mono behaviours attached (Most of which do not implement Update()). Should I be concerned about perfomance?
     
  2. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    In my opinion, you shouldn't really be concerned.

    Check out the Optimizing Scripts guide.
     
  3. ericbegue

    ericbegue

    Joined:
    May 31, 2013
    Posts:
    1,353
    It depends on how heavy your scripts actually are.
    In any case, the best way to know what is the performance impact, is to make some profiling.
     
    Kokowolo and Kiwasi like this.
  4. mathias234

    mathias234

    Joined:
    Sep 9, 2012
    Posts:
    239
    having 100 monobehaviours with no Update, is not slow. you shouldnt have a big fps hit from it