I hit a major performance chokepoint when testing a significant scale up while preparing for a v0.4 playtest.
I've managed to tame the performance significantly, and have laid the groundwork that other systems can tap into to further optimize the game.
First I added a StasisMonitor that when attached to GravityWellRigidbodies monitors their velocity and puts them to sleep when they come to a rest. Sleeping switches the Rigidbodies into a kinematic mode that can be triggered to reawaken and resume their physics simulations. This greatly reduces the amount of physics work that Unity has to perform.
However this still left hundreds of rigidbodies with active colliders spread across the world. Most of these objects are sleeping and not on screen and yet still chew up valuable resources.
So next I've added a new 'GridManager' system.
This system divides the world into a grid of cells. Cells that are visible to the players camera are activated and deactivated as you move around the planet. However by itself this would mean you could be standing beside an offscreen cell and fire a gun or throw a rock into the inactive cell and things would fail to interact at all. So active objects are also monitored to wake up any cells they may enter.
Only when all objects in a cell have come to a rest and the camera is not viewing a cell may it deactivate all its members.
This system has been a huge success. Now the game can be as performant as if the entire game were being played in a 100x100 meter square while you're walking around on a planet with 1,000's of meters of surface and cave systems.