Search Unity

Physics.Processing random spikes shown in profiler

Discussion in 'Physics' started by default_team, Jul 18, 2020.

  1. default_team

    default_team

    Joined:
    Dec 1, 2018
    Posts:
    21


    When profiling on Android, I'm seeing spikes in Physics.Processing. There's only one static Box 2D collider in the scene. If I disable that object the spikes do disappear.

    I profile the scene on a high-end Samsung device and a very old Sony device. Spikes are highly noticeable in Samsung.

    I'm getting close to releasing my Android game and this issue came to my notice just recently. I'm using Unity 2018.4.11f1
     
  2. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,474
    I know this is an old post but to be clear "Physics.Processing" is 3D (PhysX) not 2D (Box2D) physics and I'm sorry but removing a BoxCollider2D has no effect at all on "Physics.Proecssing" as that's a deep PhysX call and the two physics systems are completely isolated.

    I'm not a 3D physics dev so I'm not sure about issues with "Physics.Processing". The only thing I'd check is that FixedUpdate isn't being called many times because of delays in things ilke rendernig etc. FixedUpdate will be called as many times as is required to catch-up to game-time but it's not controlled by physics.
     
  4. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    The thing is that we had zero issues with physics on older Unity versions, and when we decided to migrate to Unity 2018 or 2019 we faced huge spikes and an overall increase in physics.processing CPU load. We later pinpointed this issue and regression happened in Unity 2018.4.0.

    Anyway, thank you for your answer. We didn't realize that this topic was related to 2D.
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,474
    To be clear I'm not discounting any issues you're having. I know nothing about it.

    It isn't really. As I said, the OP indicated that disabling a single 2D BoxCollider somehow changed this. Well, you can see my reply there. In-fact I was steering it towards 3D which of course it is. :)
     
    studentvz likes this.
  6. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Think the physics has become real heavy on Android too from some of the 2018 versions. I first thought it was the rendering but it's more depending on the number of colliders. It's like all meshes with colliders are involved in all physics calculations now, regardless of the distance.