Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

What's that warning column in the profiler?

Discussion in 'Scripting' started by scone, Jun 19, 2014.

  1. scone

    scone

    Joined:
    May 21, 2008
    Posts:
    244
    Hi there,

    I've wondered this for a while but never taken the time to figure it out. There's a column in the far right of the profiler that's not in the screenshot in the documentation. It's labeled only by a little icon with an exclamation point and a triangle, like the warning icon. However, I see, say 600 in this column for a frame that gave no warnings.

    What is this telling me? 600 whats?
     
  2. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    226
    From the release notes of Unity 4.3:
    • Profiler: Some samples are now tagged as warnings in the CPU profiler (i.e. moving of a static collider). The warnings are shown as a count in the 'warnings' column
    So, as I understand it, it just highlights some places where you can get performance hits. Moving static colliders is a big 'don't do that', so if you're gonna move something that has a collider then you should always add a rigidbody. This is just an example matching the one in the release notes.
     
  3. scone

    scone

    Joined:
    May 21, 2008
    Posts:
    244
    So is that the only thing that is warned? What if I don't see that "static collider move expensive delay cost" dealy? Is there anywhere that lists the types of things that this is warning about?

    I don't mean to be overly critical, but this is a really obtuse feature, especially considering the fact that the documentation says nothing about it at all (I read the release notes, but never would have known to go straight for the 4.3 release since I couldn't remember when the feature was added).

    Ideally we should be able to see what the warning is about in the profiler itself.

    Thanks for the answer, though!
     
  4. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    Though, a bit off topic now, I never really understood why the heck it is even possible to move a static collider without a rigidbody if it's so much of a "never do this"... The movement of colliders via transforms should be disallowed, adding a "ForceMove" method to the collider itself, explicitly stating that it is damn costy.
    Why? Because most beginners just move static colliders via its transform and later on asking why their game runs on 10 FPS.

    As of general physics, im definitly not a fan of PhysX. Unity should either build their own physics engine or implement bullet. Tho, for bullet there might be licensing issues. Anyways, this is definitly a low priority topic down their road since the roadmap clearly goes towards 2D.
     
  5. AngryAnt

    AngryAnt

    Keyboard Operator Moderator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    A list in the docs of different profiler warnings given would indeed be great.

    Regarding putting down road blocks in the API for everyone to stumble over so that a portion of the user base does not shoot off their own foot: No thanks.

    Moving a static collider is not an explicit "never do this". It is just a costly procedure to do often - thus why it is a warning and not an error or impossible to do.

    Similarly, garbage generation is bad because garbage collection can be expensive, but that doesn't mean you should never generate any garbage.

    Making a collider dynamic by attaching a rigidbody to it, means that it will be included in all nearby dynamic collision calculations, thus if you really only need to move the collider a few times, making it dynamic to do so generates a significant net loss of performance.

    Regarding not using an industry standard physics engine because it sux: No comment.
     
  6. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    226
    Ok, I managed to get a full list of calls that will trigger a warning in the Profiler:

    "Static Collider.Modify (Expensive delayed cost)"
    "Static Collider.Move (Expensive delayed cost)"
    "Static Collider.Create (Expensive delayed cost)"

    "Animation.DestroyAnimationClip [Triggers RebuildInternalState]"
    "Animation.AddClip [Triggers RebuildInternalState]"
    "Animation.RemoveClip [Triggers RebuildInternalState]"
    "Animation.Clone [Triggers RebuildInternalState]"
    "Animation.Deactivate [Triggers RebuildInternalState]"

    These are basically things that are not expensive in themselves (like AngryAnt says), but can have expensive consequences later on. This list is what we found from our own experience at the time of developing it, so if we find more or if you find anything like this that you think should be on the list, we will keep adding to it.

    Rest assured, this list and a more detailed description of what it is will be added to our documentation for a future update. Thanks for pinging us about this.
     
    GarthSmith likes this.
  7. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    I agree on that, though, I've not said that it is an error or something similar. I've just stated that, since of the fact it is so costy, it would make sense to restrict its movement by its transform and explictly adding the possiblity to still force it to move. Im saying this because many newcommers face this trap.

    Maybe its just me, but I find this statement quiet out of context.

    Yes, nothing against it. But that wasnt my point I tried to point it. Thats why I proposed to add a method to force a collider to move, incase you want to do so.
    Other than that, it was definitly just a suggestion and I dont really belive in it being ever implemented due to breaking code and functionality.

    Bullet is aswell an industry standart, just saying. Considering most open source engine's are compareable faster than PhysX and do offer quiet more possibilities to advance on.
    But I guess its somewhat specific and everyone got his own opinion on this.
    The one big problem I dislike when it comes to PhysX, is the extensive Nvidia targeted GPU acceleration. As long as GPU acceleration is not enabled, PhysX simply sux compared to other engines. As soon as you enable it, PhysX starts to suck on any non Nvidia hardware.
    Even tho the newer versions do support CPU threading, its still dedicated for GPU usage.
     
  8. garv3

    garv3

    Joined:
    Dec 30, 2012
    Posts:
    32
    Still nothing in the documentation more than four years later. Really?