Skip to main content

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 showsslows it down, so I made a world called "Udon Benchmark" that benchmarks it, the world can be found here https://vrchat.com/home/world/wrld_174475ad-6f8e-444d-8b02-67cd13e13b74
In that world I benchmarkedbench marked as many scripts I could possibly think off, for instance scripts containing for-loops, function calls, recursive functions etc. and compare their execution times

Each script got executed 50 times, and the result got averaged.

All results I'll share in this book are the results I got from my world, you'll probably get differentsdifferent 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.

LastThe updatevalue bellow shows a summary of all execution times, each line will be explained in this book, if you want you can paste those values into a .CSV file, or generate your own .CSV file in my world that features a CSV exporter.

         2023.

Version 1.1 - Number of iterations : February50 B1

(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
Buildin functions vs calculating something manually (part 1)166.699154161.6328189.95425.5493790515772192.67843488.3964125.42386.552328135055811.79868332691077
Buildin 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