Performance
Last updated
Last updated
Some people asked me about the performance cost of using Soap. Soap has been used in many commercial games (most on mobile/web GL), and performance issues were never related to using Soap. For those who are still curious, please read the explanations below.
Soap variables, lists and events rely on native C# events for callbacks. Soap custom editors and features are kept simple and minimal to stay efficient and performant (as opposed to some other ScriptableObject architecture frameworks). For example, scriptable variable operation is the fastest in Soap compared to other popular frameworks.
Setting the value of a Scriptable Variable every frame will create some garbage (few bytes) due to boxing and unboxing. Unfortunately, all the scriptable object architectures have the same issue. In most cases though, it is not common to have a lot of variables that have their value set every frame. Furthermore, it is rare that this amount of garbage becomes an issue, but I still want to mention it.
By assigning references in the editor with scriptable objects you don’t need to solve the references at runtime (as opposed to a traditional Dependency injection framework).