Udon Benchmarking and performance tests
A few weeks ago I benchmarked Udon, and I decided to share the results here.
So if you're curious to know how to make your U# code more performant, you can check it out here!
The introduction just explains how I benchmarked Udon.
In the second chapter, I share all my benchmarking results.
I also give a few optimization tips in the last chapter.
For questions, you can contact me on Twitter (https://twitter.com/MyroDev) or post comments.
Introduction
Last update : February 2023 As many of you may already know, Udon can be pretty slow, but I was ...
Let's run some benchmarks!
In this chapter I am executing scripts in C# and U#, and compare execution times
U# vs C#
U# is noticeably slower than regular C#, to benchmark it I decided to execute two scripts in U# a...
For loop
For this test I was curious to see how well Udon executes for-loops, and the results I got were r...
Recursive vs iterative
For this test I was curious to see how well Udon executes recursive methods, in the previous test...
Builtin functions vs calculating something manually
Let's say you want to calculate the distance between two vectors. Some of you would probably wri...
Function overhead test
For this test I was curious to see the overhead of a function call I executed two methods Benchm...
GetComponent<>()
Many of you may already know that calling GetComponent is pretty expensive in Unity. But how exp...
Calling methods from a separate script
Let's say you have script A that accesses a method from script B. Would it be more performant to...
Caching Networking.LocalPlayer
Some programmers like to cache the local player for later use, for instance by adding a private m...
The "ref" keyword
U# now supports the "ref" keyword, which is really cool! For those who don't know what the "ref" ...
400 Update() calls vs one Update() call iterating 400 times
What would be more performant in Udon? 400 GameObjects executing some code every frame with an...
Other Udon optimization tips
Update events, like Update() or FixedUpdate() It is generally not recommended to execute code ev...