Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

A WebGL benchmark of the GetComponent function in Unity

A topic by TheNudist created Aug 05, 2022 Views: 429
Viewing posts 1 to 1

I built a benchmark to stress GetComponent in Unity, in response to widespread concern over its performance.

After building the test, I've decided to share it, since I could find no real online sources besides some old and controversial and user benchmarks. This was designed to address a major complaint with those, namely that simply running GetComponent repeatedly in a loop does not produce valid results, due to compiler optimization. In mine, a different component is chosen at random each iteration.

Your results will depend on your device. On mine, I can run 1000-2000 iterations without any apparent stutter in the on-screen movement. 

I hope it is helpful for someone.

https://thenudist.itch.io/unity-getcomponent-benchmark