# Introduction

Last update : February 2023

As many of you may already know, Udon can be pretty slow, but I was curious to know what really slows it down, so I made a world called "Udon Benchmark" to benchmark it, the world can be found here [https://vrchat.com/home/world/wrld\_174475ad-6f8e-444d-8b02-67cd13e13b74](https://vrchat.com/home/world/wrld_174475ad-6f8e-444d-8b02-67cd13e13b74) In that world I benchmarked : - The execution time between C# and U# - As many C# features I could possibly think off, for instance for-loops, function calls, recursive functions etc. and compare their execution times. Each script got executed 50 times, and the results got averaged.

All results I'll share are the results I got from my world, you'll probably get different results on your hardware.

Since VRChat keeps improving Udon, many results I'll share will probably be out of date in the future, and I cannot promise that I'll keep those values up-to-date.

The values bellow shows a summary of all execution times, I'll explain each line in the next chapter, if you want you can paste those values into a .CSV file, or generate your own .CSV file in my "Udon Benchmark" world that features a CSV exporter. - B1 : execution time of the Benchmark1 method - B2 : execution time of the Benchmark2 method - SD : Standard deviation, which shows the amount of variation or dispersion of a set of values [https://en.wikipedia.org/wiki/Standard\_deviation](https://en.wikipedia.org/wiki/Standard_deviation)
Version 1.1 - Number o iterations : 50B1 (ms)B1 min (ms)B1 max (ms)B1 SDB2 (ms)B2 min (ms)B2 max (ms)B2 SDB1/B2
C# vs U# (Part 1)684.576946661.567804.889121.4634273630957
C# vs U# (Part 2)972.71161928.64021119.348435.2456449139138
For-loop overhead test79.90354476.929694.9513.7094664621834835.38859633.334153.88283.810114100651582.25788963201592
Recursive vs iterative532.552632519.5953577.749712.928078805892979.85917477.083393.39143.691705085773246.6686468858293
Builtin functions vs calculating something manually (part 1)166.699154161.6328189.95425.5493790515772192.67843488.3964125.42386.552328135055811.79868332691077
Builtin functions vs calculating something manually (part 2)60.5831957.867578.66513.7962520951722963.03463260.812776.25382.81868126409780.961109600830223
Function overhead test57.0363854.490465.09392.9275587711948766.2072263.020581.52243.637242050565240.861482780880997
GetComponent<>()60.057658.044769.70742.32634479559673111.367394106.5221122.62883.817782588959720.539274538470389
Calling methods from a separate script236.120418228.2506261.77787.89126462852919305.513994297.6651333.5787.459771742122140.772862856161017
Caching Networking.LocalPlayer15.09744814.574118.53210.78361631663461418.25172817.774526.39321.238964471329180.827179103260798
The "ref" keyword14.85962413.910522.69061.7901058571559414.17115813.469318.11171.238863504360351.04858219772865