Created page with "Compter le nombre de slots d'une création n'est une bonne manière de mesurer l'impact sur la performance de cette création." |
Updating to match new version of source page |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<languages/> | <languages /> | ||
[[File:FrooxSlotCount.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">[https://discord.com/channels/1040316820650991766/1154514007479287942/1244377897582592111 Post by Frooxius] regarding the use of Slot count as a performance metric on the [[Resonite Discord]]</span>|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Discord post by Frooxius saying: Keep in mind slot count isn't really good performance metric. It can be very misleading, but I see people keep using it. It's kinda like measuring performance of a car by how many screws it has.</span>]] | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
A common misconception that proliferated mainly during Resonite's early days is that the amount of [[slots]] that an object contains is directly related to how performant the object is. This is not usually the case. It is also stated that slot count has no impact on performance at all. This is also not usually the case, and the reality is slightly more complicated than both extremes. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
In general, at a baseline level, the amount of slots on an object does not affect its performance within the world. A world that contains a high-slot count item will, in general, not perform any worse than a world without said high slot count item when considered in a vacuum. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The real slowdown of slot count starts when functions need to iterate over all the slots and potentially components of an item while also performing some action. This requires multiple hits of [https://en.wikipedia.org/wiki/Memory_management#HEAP heap memory] and isn't very [https://en.wikipedia.org/wiki/Cache_(computing) cache] friendly. The effects of these kinds of actions can usually start to be felt after a slot count of 10000-100000+ depending on the amount of components on each slot and the action that is being performed. This includes, but is not limited to: | |||
</div> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Duplicating or destroying slots.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Computing the [[ProtoFlux:Compute Bounding Box|bounding box]] of a slot. This is used in [[gizmo]] rendering of the slot, for example.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">The [[ProtoFlux:Body Node Slot|Body Node Slot]] node, especially if it can not find the body node or the body node is "low" in the slot hierarchy it searches over. This can become especially bad with [[ContinuouslyChanging]] in a flux group.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Selecting items with the [[Dev Tool]]. This iterates over only slots{{em dash}}not components{{em dash}}of the entire world root, and as such its effect is much less pronounced than the other items in this list.</span> | |||
== Element count == | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Another slowdown that slots <em>contribute</em> to{{em dash}}but are not always the main cause of{{em dash}}are iterations over all the [[Type:IWorldElement|elements]] of an item. This includes, but is not limited to: | |||
</div> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Initial synchronization of a world. The more slots, components, whatever elements there are in a world, the longer it will take to synchronize the world state.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Initial spawning and loading of an item.</span> | |||
== <span lang="en" dir="ltr" class="mw-content-ltr">Other causes of slowdowns</span> == | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Some hitches or slowdowns that may be mistaken for slot count but are usually caused by other factors include: | |||
</div> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">[[ProtoFlux]] compilation on item spawn. If an object contains a ton of ProtoFlux, it will take time to compile it on spawn. While conventionally, ProtoFlux is done on a one-node-per-slot basis, the slowdown mainly comes from the components rather than the slots.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Avatar hitching on load. This is usually caused by a large amount of blendshapes on a high-poly mesh, as the game has to recompute the mesh for every blendshape on load. This may also be caused by RAM/VRAM [https://en.wikipedia.org/wiki/Memory_paging paging] during allocation.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">General avatar lag. This could be due to many factors, but it's rarely from slot count alone. If blendshapes on a high-poly mesh are being changed frequently, the aforementioned recomputation of the entire mesh will be done, causing lag. If there is generally a large amount of bones and vertices, IK can cause lag from computing the mass amount of slot transforms and mesh deformations.</span> | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">Slow raycasts. This is caused by a large amount of heavy colliders in a world, mainly [[Component:ConvexHullCollider|convex hull colliders]] and [[Component:MeshCollider|mesh colliders]]. It is generally advised to optimize the colliders in a world as much as possible.</span> | |||
== <span lang="en" dir="ltr" class="mw-content-ltr">See also</span> == | |||
* <span lang="en" dir="ltr" class="mw-content-ltr">[[Optimization guidelines]] for more in-depth guidelines about optimization in general.</span> |
Latest revision as of 14:45, 5 May 2025

A common misconception that proliferated mainly during Resonite's early days is that the amount of slots that an object contains is directly related to how performant the object is. This is not usually the case. It is also stated that slot count has no impact on performance at all. This is also not usually the case, and the reality is slightly more complicated than both extremes.
In general, at a baseline level, the amount of slots on an object does not affect its performance within the world. A world that contains a high-slot count item will, in general, not perform any worse than a world without said high slot count item when considered in a vacuum.
The real slowdown of slot count starts when functions need to iterate over all the slots and potentially components of an item while also performing some action. This requires multiple hits of heap memory and isn't very cache friendly. The effects of these kinds of actions can usually start to be felt after a slot count of 10000-100000+ depending on the amount of components on each slot and the action that is being performed. This includes, but is not limited to:
- Duplicating or destroying slots.
- Computing the bounding box of a slot. This is used in gizmo rendering of the slot, for example.
- The Body Node Slot node, especially if it can not find the body node or the body node is "low" in the slot hierarchy it searches over. This can become especially bad with ContinuouslyChanging in a flux group.
- Selecting items with the Dev Tool. This iterates over only slots—not components—of the entire world root, and as such its effect is much less pronounced than the other items in this list.
Element count
Another slowdown that slots contribute to—but are not always the main cause of—are iterations over all the elements of an item. This includes, but is not limited to:
- Initial synchronization of a world. The more slots, components, whatever elements there are in a world, the longer it will take to synchronize the world state.
- Initial spawning and loading of an item.
Other causes of slowdowns
Some hitches or slowdowns that may be mistaken for slot count but are usually caused by other factors include:
- ProtoFlux compilation on item spawn. If an object contains a ton of ProtoFlux, it will take time to compile it on spawn. While conventionally, ProtoFlux is done on a one-node-per-slot basis, the slowdown mainly comes from the components rather than the slots.
- Avatar hitching on load. This is usually caused by a large amount of blendshapes on a high-poly mesh, as the game has to recompute the mesh for every blendshape on load. This may also be caused by RAM/VRAM paging during allocation.
- General avatar lag. This could be due to many factors, but it's rarely from slot count alone. If blendshapes on a high-poly mesh are being changed frequently, the aforementioned recomputation of the entire mesh will be done, causing lag. If there is generally a large amount of bones and vertices, IK can cause lag from computing the mass amount of slot transforms and mesh deformations.
- Slow raycasts. This is caused by a large amount of heavy colliders in a world, mainly convex hull colliders and mesh colliders. It is generally advised to optimize the colliders in a world as much as possible.
See also
- Optimization guidelines for more in-depth guidelines about optimization in general.