Performance of instances


I have an application where I have around 2000 instances of a mesh. This number is dynamic, could be less/more of them, depends on the content of an imported .json. Also there is an editing option so I need to be able to move the instances around. The application is going to have some other meshes in the future but when I try it out with just this one mesh I already have some performance problems. Do you have any tips to improve on this?

I tried out some of the options that I found here: Babylon.js docs and here: Babylon.js docs but I was not able to achieve anything considerable.

I also noticed that when less instances are in the view of the camera the performance gets better but it could be possible in my application that all of the instances are in the view so in the PG I did not set the position of the instances.

Scene optimization is very uch scene-dependent. It depends on your use case, on the meshes you are going to duplicate, on how you use those meshes.

If your example is somewhat representative, you could enable the aggressive performance mode - performance | Babylon.js Playground (

You should read about what the aggressive mode does here - Optimizing Your Scene | Babylon.js Documentation ( to know what the side effects are (for example - i added environment, because autoClear is off :slight_smile: )

1 Like

If possible, you should use thin instances instead of instances.


for detailed explanations on this feature.


Thank you for the replies, I will look into if I can use thin instances. If not, then I will try to use the agressive or intermediate mode.

While working on some other aspects of my application I found something that helped a lot with the performance and FPS (went from ~20 to ~60): reducing the tesselation of the torus and the segments of the sphere. This reduced the number of total indices and vertices by a lot.

Indeed. As said above, the performance optimization process is very much depending on your scene and is often the result of some sort of ‘compromise’.
Indices, vertices, the number of meshes, draw calls, materials, animations, particles, instructions on run time and of course post process… all have an incidence. Even without using the ‘preset’ aggressive performance mode, you can test try implement parts of it in your scene. Then check what you can keep, what makes no difference and what eventually would break the scene.

Here are a few that I tried with some positive results in my own project:

Note: I’m not sure if when merging meshes, the ‘freeze’ remains for each submaterial. In doubt, I’d rather ‘freeze’ the material (or all materials) after merge/build. Then eventually ‘unfreeze’ the ones causing issues.

1 Like