# Scaling performance đ
> Quick guide with tips to improve performance of your Tres.js application.
We are running WebGL on the browser, which can be quite expensive and it will depend on how powerful the user's device is. To make 3D accessible to everyone, we need to make sure our applications are optimized to run also on low-end devices. This guide will provide some tips to improve the performance of your Tres.js application.
## On-demand rendering
By default, Tres.js will render your scene on every frame. This is great for most applications, but if you are building a game or a complex application, you might want to control when the scene is rendered.
Otherwise it might drain your device battery đ đ đĒĢ and make your computer sound like an airplane đĢ.
Ideally, you only want to **render the scene when necessary**, for example when the user interacts with the scene and the camera moves, or when objects in the scene are animated.
You can do that by setting the `renderMode` prop to `on-demand` or `manual`:
### Mode `on-demand`
```vue
```
#### Automatic Invalidation
When using `render-mode="on-demand"`, Tres.js will automatically invalidate the current frame by observing component props and lyfecycle hooks like `onMounted` and `onUnmounted`. It will also invalidate the frame when resizing the window or change any prop from the `` component like `clearColor` or `antialias`.
This will trigger a new render:
```vue
```
#### Manual Invalidation
Since is not really possible to observe all the possible changes in your application, you can also manually invalidate the frame by calling the `invalidate()` method from the [`useTresContext` composable](../api/composables.md#usetrescontext):
::: code-group
```vue [App.vue]
```
```vue [Scene.vue]
```
:::
### Mode `always`
In this rendering mode, Tres will continously render the scene on every frame. This is the default mode and the easiest to use, but it's also the most resource expensive one.
### Mode `manual`
If you want to have full control of when the scene is rendered, you can set the `render-mode` prop to `manual`:
```vue
```
In this mode, Tres will not render the scene automatically. You will need to call the `advance()` method from the [`useTresContext` composable](../api/composables.md#usetrescontext) to render the scene:
```vue
```