Performance issues with Build Physics World

I’ve been trying to figure out the performance issues for quite some time, without any success.
I created around 60k entities - all of them are static and have simple colliders. There’s only one object that they’re actually able to collide with. This is networked, although again I’m not sure if this is actually relevant here.

ServerWorld BuildPhysicsWorld takes around 70 ms, out of which apparently 45 ms is idle, 17 ms is AnalyticsJobs: PhysicsBodiesAnalyticsJob (whatever that is), and only 2.5 ms is Jobs:createRigidBodies (with everything else combined taking under 0.2 ms, and in some frames DispatchPairSequencer:RadixSortPerBodyAJob takes a few ms). Another 22 ms is in EndSimulationEntityCommandBufferSystem, almost all of that is idle too.
In ClientWorld, BuildPhysicsWorld takes around 200 ms, with 133 ms idle, 52 ms on AnalyticsJobs: PhysicsBodiesAnalyticsJob, and 7 ms on Jobs:CreateRigidBodies.

So, what is happening? Why is there so much idle time? What are those analytics jobs, is that debug info (that I could hopefully turn off, like I did with the integrity checks), or something actually needed? What can I do to make this actually work?

6 Likes

Looks like PhysicsBodiesAnalyticsJob only happens in the editor and when the preprocessing symbol ENABLE_CLOUD_SERVICES_ANALYTICS is defined (it’s guarded by
#if UNITY_EDITOR && ENABLE_CLOUD_SERVICES_ANALYTICS)
.
I have been trying to remove that symbol so that those analytics jobs won’t run, but couldn’t find a way to do so. If anyone knows how to do that let me know. I don’t need those analytics and the PhysicsBodiesAnalyticsJob is taking 2ms per frame and ruining the performance in the editor.

1 Like

same here,with 70k static colliders, BuildPhysicsWorld takes 700ms to run ( death spiral )

any idea how to disable PhysicsAnalyticsSystem ?

1 Like

Note that this system is excluded in builds.
We are looking at speeding it up at the moment. Enabling burst makes a big difference here also.

2 Likes

Quick update here:

In the latest 1.3 version of Unity Physics, the analytics systems are parallelized and run way faster than before and are also now disabled when analytics are disabled in the editor.

Would you mind posting this in a seperate thread as this thread here was about time spent in the analytics jobs and is already resolved?

Feel free to ping me in the new thread.

Thanks!