Overhead of instanciated disabled objects in VRC

Hay all, I have noticed that when generating a maze in VRC that disabled game objects start to take a big chunk of overhead. In the editor when done generating it returns to its 500+ fps, while in VRC it all the way goes down to 25fps.

Is there any reason anyone knows why this is the case?

Have you checked what the source of the FPS loss might might?

Are you getting a lot of draw calls? Or do you have a lot of Udon script with an Update event?

I have a single script with an update event (for following the local player). so this shouldn’t be the problem as disabling it doesn’t change performance.

For draw calls, there are none from these objects because there disabled.

And in the editor after running at 150 fps for a bit it returns to 500+ fps.
While in vrchat it starts at 90(vsync) and goes down to 25 over time.

I also have tested with all my networking disabled and this doesn’t have an effect on performance.

To give a little more info about the project


example of image format of the map (all cells have walls, floor, decorations, …)

Hmmm that’s a lot of overlapping transparency. What platform were you testing on, PC? On Quest this definitely would not run well.

Ik that but atm pc only. and this is also just a debug view.

How many objects is the map composed of? Do they have any expensive components attached? Is there any instancing going on? How many draw calls does your scene take?

Sorry, just going through everything I can think of :sweat_smile:

npnp. as for expensive objects, they have no udon behaviors. No lights, only transform, mesh filter, mesh renderer, box collider.

What happens if you use a simpler material? Mobile diffuse, for example, with GPU instancing enabled?

all objects have GPU instancing enabled. have mobile diffuse. All objects are disabled and out of camera view.

Oh sorry, my comment was in relation to your visualization view.

TBH, I’ve always avoided dynamically spawning objects in favour of using an object pool. Perhaps someone more knowledgable about about instantiating objects could pitch in…

For object pool management you can try these:

CyanLaser’s object pool

Phasedragon Made original SimpleObjectPool prefab

Those object pools are for the purpose of assigning a unique object per player, not for spawning arbitrary objects into the scene. They are not relevant to this particular use case.

After further testing, this seems to be an oversight or a bug. So I made a canny post.

I have reported it as a bug but I don’t know if it is a limitation for a system like VRChat or if we should try to do things differently. Due to how slow udon I currently have not found an “acceptable” alternative. acceptable meaning within 90+ fps without frame spikes.