Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

66 ms CPU profiler spikes in empty project

Discussion in 'Unity 5 Pre-order Beta' started by Kavorka, Feb 11, 2015.

  1. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    I just started using Unity 5 candidate. After I converted my project and fixed the conversion errors I immediately noticed it was lagging. I opened the profiler and saw these 66 ms CPU spikes, green, indicating rendering. I have tried the example projects and an empty project, it is the same every time. A 66 ms spike is pretty nasty.

    Computer is alienware laptop with i7 and gtx675m. No problems with Unity 4.
    I did some looking around on the forum and release notes but found no solution.
    Can you please tell me what I missed, what do I have to do to get an empty (or not empty) project to run smoothly?


    And how do I upload an image directly from the computer? I had to put this on the web to post it, is that really necessary?

    If I turn of VSync I get this



    Thanks
     
    Last edited: Feb 11, 2015
  2. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    It might help if you were to put the line in the profiler inside one of those spike so you can see what's causing it.
     
  3. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Thanks for helping. I figured that if a fresh empty project is laggy someone else must have encountered it and immediately know why.

     
    Last edited: Feb 13, 2015
  4. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    I had that problem before as well, I mistakenly moved my windows around and it stopped, maybe its the same for you, no idea though. That's at least how it appeared for me, except mine was constantly bogged down, not spikes occasionally.
     
  5. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
  6. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Thanks for your input.

    I like Unity, I applaud the value they provide, just not this minute.

    This totally demotivates me. I don't want to start working in Unity 5 until this is solved and I don't want to work in the obsolete Unity 4 either. This could well be all on me, something I did, neglected to do or something with my computer. Still, UT failed to anticipate that I would do that or run on such a computer. UT get a lot of cred for their workflow, but I am not productive now, am I?
     
    Last edited: Feb 13, 2015
  7. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Try cutting off Realtime GI, Realtime Light Baking, etc. Baking takes ages, and could be a culprit on why it's going so slow.
     
  8. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Good tips.
    I found yesterday that the spikes are from the profiler itself, I can see in the scene that the spikes disappear when I close the profiler. I also found that the particle systems, (no shadows cast or received) which were cheap in Unity 4, is super duper expensive in Unity 5.
    At least now I can use Unity 5 if I don't profile, and disable the particles. There is still something laggy in a script (that was not laggy in unity 4). I am tracking it down but I have to do it without the profiler, since the profiler is perfectly unusable.

    Thanks again
     
    Last edited: Feb 14, 2015
  9. chase-cobb

    chase-cobb

    Joined:
    Aug 16, 2011
    Posts:
    51
    As DanSuperGP said, this is caused by vsync being turned on. The CPU has nothing to do in a blank scene, which causes a wait before drawing the current frame. To turn it off, set the circled setting to "Don't Sync" on the currently used quality level, from the matrix at the top of the window. Hope that helps!



    Link to larger image
     
  10. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Thank you very much. Tried it, spikes are not caused by VSync. The spikes disappear if i close the profiler. The other lagginess of the scene depends on what is selected in the hierarchy. Not so laggy if the terrain is selected, very laggy if the character is selected. I am working around it and waiting for the next candidate to be released.
     
  11. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Profiler if character is selected



    Profiler if terrain is selected



    No profiler window open and terrain selected, frame rate is better, good most of the time.




    It looks like the CPU is waiting for the GPU which is busy doing "Other".
     
    Last edited: Feb 14, 2015
  12. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    I've had performance problems for a long time when there are things selected in the Heirarchy. It doesn't reflect the normal performance at all. If you want to see how your scene is performing, always make sure you have nothing selected in the heirarchy first.