Skip to content

[UGUI] Performance Improvement to not create GameObjects that are empty #77

@Muchaszewski

Description

@Muchaszewski

If a component does not have anything, do not spawn it. Eg: [Shadows] or [BorderImage].
It should improve reload/update speed significantly.
image

The rate at which new GameObjects are added is connected directly to the about of said game objects on the scene and their hierarchy.
From my tests in the past, creating a Single "Empty Object" on a scene with 2500 objects can be around 1-2ms on a mid-low end PC (slower on mobile). Adding MonoBehaviour has a similar performance effect but 1/4 the penalty.

This can be part of Pooling behavior, to not spawn objects when they would be needed they can should be quickly taken from a pool. But be aware, that changing the rendering order (enable/disable GO included) forces Canvas to re-render the whole path to the next Canvas.

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance issues & questions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions