Help! My world is laggy and jittery! Using Real-Time Performance Metrics to understand your world.
So, you've built a great world, and gotten all the meshes and interactions implemented to make it engaging for your players, but when you go in to play test it, the framerate is awful, and actions sometimes stutter when you try to initiate some scripted interaction.
You've probably overextended the runtime in some way and are going to have to 'performance optimize' your world.
The first step is going to be to get some _concrete_ measurements as to what is wrong, and the best way to do that is to use the in-world performance panel tools. In VR, you can bring this up by first enabling the Utilities menu in Settings, and then selecting "Real-time Metrics' from your wrist menu. On Web (but not desktop or mobile), you can bring up the same metrics under the viewport by pressing P.
Once you have the panel up, there are a variety of metrics to configure. The most important is FPS, which you want to maintain above 70 at all times (60 for web). But to do so, you will need to look at a variety of other stats to see what things are straying 'out of bounds' and need to be addressed.
What to optimize:
- Draw calls
- You have too many discrete meshes and textures in view at one time. Reduce/combine them.
- GPU
- Too much work is being done by the GPU to draw the scene due to too complex modules, particles, or high rez textures.
- Physics
- Too many collisions to process, including from both active physics objects, anything collidable, and triggers.
- Scripting
- The code being executed in typescript is taking too long, perhaps due to inefficient algorithms or too many bridge calls.
- Custom ui bindings
- If there are too many binding updates per second, or the bindings are too complex, it can cause UI updates to freeze
There are a number of other metrics to look at, which are described in detail in the below docs.
- Overview of Real Time metrics
- Real Time Metrics on web/mobile
Happy performance tuning!