Search Unity

Terrible performance spikes (~1500ms), EventSystem.Update()

Discussion in 'Scripting' started by gilgm, Sep 25, 2015.

  1. gilgm

    gilgm

    Joined:
    Dec 31, 2012
    Posts:
    7
    So, I'm getting some really awful performance spikes, and having a tough time determining where the latency is coming from; the profiler isn't giving me many details as to what is chewing up CPU.

    Maybe I'm missing something?







    From what I can see, we aren't doing any substantial allocation, and "EventSystem.Update()" listing object "N/A" doesn't really help me break anything down. Thoughts?

    Thanks,
    -M
     
  2. martinmr

    martinmr

    Joined:
    Mar 25, 2015
    Posts:
    325
    have you tried to make a "Depp Profile" ? You will see more detailed profiler logs.
    there is a button in your profiler where you can set this option on.

    in this one frame you are deactivatin over 4000 Gameobjects :O

    Also your Debug Logs are causing some Garbage
     
  3. Duugu

    Duugu

    Joined:
    May 23, 2015
    Posts:
    241
    I am just guessing: given the massive amount of Gameobject.Deactivate calls you're probably doing something on activate/deactivate of the gameobjects causing the allocation of memory from the heap? Like in Start() or Awake() of scripts that are attached to the gameobjects?
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    The 4000 deactivates are probably a decent clue. What are these objects being deactivated? And can you avoid it or spread the cost across multiple frames?