Search Unity

Really weird peaks when profiling a simple scene with Unity3D

Discussion in 'Editor & General Support' started by hexdump, Jul 20, 2013.

  1. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    I need some help optimizing my game. I have spent last 3 days digging around with no luck. I have noticed really odd results in the unity profiler so, I have created a simple scene with just a cube and a camera, and again, really odd results. Could anybody have a look at this sceenshots?:

    http://postimg.org/image/v2pxzteqb/

    http://postimg.org/image/nb9819akz/

    http://postimg.org/image/wghkv4dzn/

    You will see some significant peaks that make the frame time too high (30fps sometime or less). Scene hasn't any script, no coliders, no rigid bodies (notice the Physics simulate % in one of the shots).

    Could anybody explain what is happening?

    PD. Target platform is Android. This are taken from a Nexus 4 device.
    PD2. Somebody can argue that this is not a real scenario, but I have had this problems in a real game myself and wanted to show a simple example to expose the problem.

    Thanks in advance.
     
  2. Ben-Massey

    Ben-Massey

    Joined:
    Jun 13, 2011
    Posts:
    581
    Last edited: Jul 20, 2013
  3. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Hi!,

    Yup, I noticed the vsync issue, I have disabled it. what about the camera.render peaks? they are really inconsistent too :(. I'm a bit shocked about unity team not explaining this or giving hints about this scenarios because they seem pretty common in the forums. The problem is that there are no answer to the questions.

    Any help would be appreciated.

    Thanks in advance.
     
    Last edited: Jul 20, 2013
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    94.3% in Shader.SetPass looks really odd to me. What shaders are you using? Can you remove materials until you locate the material that causes this behaviour. Physics.Simulate sounds odd if you have literally no physics in the scene.
     
  5. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Um, what's shocking about that? You've posted on a community site. The Unity devs try and help when they can. I don't think you should expect a Unity employee to respond to every thread on this site. And expecting one inside 9 hours somewhat, um, shocks, me. ;-) If you need assistance inside 8 hours, we do have support services you can purchase. (Oh, and look, it's a Saturday morning, and I'm not at work, but still responding to you.)
     
  6. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Well, this are problems that I have seen around since 2011 in other posts. Previously I was refering to that, not talking about no one at Unity team not answering today to my question :). Sorry if I sounded rought. I really appreciate your help and time.

    About the shaders, I just have a shader set on the box, and it is the default diffuse one :/. On the other hand I have added a collider to the box to check if Physics.Simulate was having a different behaviour, but it behaves the same. I have attached the scene.

    P.D. Could it be I shouldn't take this odd reads into account? Perhaps this peaks are not really happening? I don't mind for highest devices but for low end ones, every cycle is important.
     

    Attached Files:

    Last edited: Jul 20, 2013
  7. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443