godotengine / godot-benchmarks

Collection of benchmarks to test performance of different areas of Godot
MIT License
122 stars 32 forks source link

Port GDScript benchmarks to C# #84

Closed OverloadedOrama closed 2 months ago

OverloadedOrama commented 3 months ago

Ports the following GDScript benchmark suites to C#:

Note that in order for you to run C# benchmarks in Godot 4.3, #82 needs to be merged first.

Results on my PC { "benchmarks": [ { "category": "Csharp > Alloc", "name": "Deep Tree", "results": { "time": 904.4 } }, { "category": "Csharp > Alloc", "name": "Duplicate", "results": { "time": 2405 } }, { "category": "Csharp > Alloc", "name": "Fragmentation", "results": { "time": 9214 } }, { "category": "Csharp > Alloc", "name": "Wide Tree", "results": { "time": 658 } }, { "category": "Csharp > Binary Trees", "name": "Binary Trees 13", "results": { "time": 81.57 } }, { "category": "Csharp > Binary Trees", "name": "Binary Trees 15", "results": { "time": 366.3 } }, { "category": "Csharp > Binary Trees", "name": "Binary Trees 18", "results": { "time": 2220 } }, { "category": "Csharp > Hello World", "name": "Hello World", "results": { "time": 0.222 } }, { "category": "Csharp > Lambda Performance", "name": "Lambda Call", "results": { "time": 4.27 } }, { "category": "Csharp > Mandelbrot Set", "name": "Mandelbrot Set", "results": { "time": 397.1 } }, { "category": "Csharp > Merkle Trees", "name": "Merkle Trees 13", "results": { "time": 71.75 } }, { "category": "Csharp > Merkle Trees", "name": "Merkle Trees 15", "results": { "time": 367.2 } }, { "category": "Csharp > Merkle Trees", "name": "Merkle Trees 18", "results": { "time": 4393 } }, { "category": "Csharp > Nbody", "name": "Nbody 1 000 000", "results": { "time": 389.9 } }, { "category": "Csharp > Nbody", "name": "Nbody 500 000", "results": { "time": 193.8 } }, { "category": "Csharp > Spectral Norm", "name": "Spectral Norm 100", "results": { "time": 4.813 } }, { "category": "Csharp > Spectral Norm", "name": "Spectral Norm 1000", "results": { "time": 470.6 } }, { "category": "Csharp > Spectral Norm", "name": "Spectral Norm 500", "results": { "time": 109.2 } }, { "category": "Csharp > String Checksum", "name": "Md 5 Buffer Empty", "results": { "time": 892.2 } }, { "category": "Csharp > String Checksum", "name": "Md 5 Buffer Non Empty", "results": { "time": 1274 } }, { "category": "Csharp > String Checksum", "name": "Md 5 Text Empty", "results": { "time": 2452 } }, { "category": "Csharp > String Checksum", "name": "Md 5 Text Non Empty", "results": { "time": 3028 } }, { "category": "Csharp > String Checksum", "name": "Sha 1 Buffer Empty", "results": { "time": 1090 } }, { "category": "Csharp > String Checksum", "name": "Sha 1 Buffer Non Empty", "results": { "time": 1246 } }, { "category": "Csharp > String Checksum", "name": "Sha 1 Text Empty", "results": { "time": 3093 } }, { "category": "Csharp > String Checksum", "name": "Sha 1 Text Non Empty", "results": { "time": 3219 } }, { "category": "Csharp > String Checksum", "name": "Sha 256 Buffer Empty", "results": { "time": 1025 } }, { "category": "Csharp > String Checksum", "name": "Sha 256 Buffer Non Empty", "results": { "time": 1188 } }, { "category": "Csharp > String Checksum", "name": "Sha 256 Text Empty", "results": { "time": 4344 } }, { "category": "Csharp > String Checksum", "name": "Sha 256 Text Non Empty", "results": { "time": 4495 } }, { "category": "Csharp > String Format", "name": "Complex Variable Concatenate", "results": { "time": 567.1 } }, { "category": "Csharp > String Format", "name": "Complex Variable Method", "results": { "time": 26090 } }, { "category": "Csharp > String Format", "name": "Complex Variable Percent", "results": { "time": 527.6 } }, { "category": "Csharp > String Format", "name": "No Op Constant Method", "results": { "time": 1260 } }, { "category": "Csharp > String Format", "name": "Simple Constant Concatenate", "results": { "time": 2.985 } }, { "category": "Csharp > String Format", "name": "Simple Constant Method", "results": { "time": 7633 } }, { "category": "Csharp > String Format", "name": "Simple Constant Method Constant Dict", "results": { "time": 3043 } }, { "category": "Csharp > String Format", "name": "Simple Constant Percent", "results": { "time": 3.059 } }, { "category": "Csharp > String Format", "name": "Simple Variable Concatenate", "results": { "time": 34.28 } }, { "category": "Csharp > String Format", "name": "Simple Variable Method", "results": { "time": 8307 } }, { "category": "Csharp > String Format", "name": "Simple Variable Percent", "results": { "time": 50.01 } }, { "category": "Csharp > String Manipulation", "name": "Begins With", "results": { "time": 45.48 } }, { "category": "Csharp > String Manipulation", "name": "Bigrams", "results": { "time": 313.3 } }, { "category": "Csharp > String Manipulation", "name": "Capitalize", "results": { "time": 2498 } }, { "category": "Csharp > String Manipulation", "name": "Casecmp To", "results": { "time": 73.5 } }, { "category": "Csharp > String Manipulation", "name": "Contains", "results": { "time": 14.96 } }, { "category": "Csharp > String Manipulation", "name": "Count", "results": { "time": 121.5 } }, { "category": "Csharp > String Manipulation", "name": "Countn", "results": { "time": 130.9 } }, { "category": "Csharp > String Manipulation", "name": "Ends With", "results": { "time": 42.25 } }, { "category": "Csharp > String Manipulation", "name": "Find", "results": { "time": 23.36 } }, { "category": "Csharp > String Manipulation", "name": "Findn", "results": { "time": 19.71 } }, { "category": "Csharp > String Manipulation", "name": "Insert", "results": { "time": 27.87 } }, { "category": "Csharp > String Manipulation", "name": "Is Valid Filename", "results": { "time": 113.9 } }, { "category": "Csharp > String Manipulation", "name": "Lpad", "results": { "time": 32.98 } }, { "category": "Csharp > String Manipulation", "name": "Nocasecmp To", "results": { "time": 63.22 } }, { "category": "Csharp > String Manipulation", "name": "Pad Decimals", "results": { "time": 291.9 } }, { "category": "Csharp > String Manipulation", "name": "Pad Decimals Pre Constructed", "results": { "time": 51.4 } }, { "category": "Csharp > String Manipulation", "name": "Pad Zeros", "results": { "time": 113.6 } }, { "category": "Csharp > String Manipulation", "name": "Pad Zeros Pre Constructed", "results": { "time": 114.4 } }, { "category": "Csharp > String Manipulation", "name": "Rfind", "results": { "time": 29.39 } }, { "category": "Csharp > String Manipulation", "name": "Rfindn", "results": { "time": 65.1 } }, { "category": "Csharp > String Manipulation", "name": "Rpad", "results": { "time": 38.79 } }, { "category": "Csharp > String Manipulation", "name": "Similarity", "results": { "time": 561.6 } }, { "category": "Csharp > String Manipulation", "name": "Simplify Path", "results": { "time": 2637 } }, { "category": "Csharp > String Manipulation", "name": "Split", "results": { "time": 109.8 } }, { "category": "Csharp > String Manipulation", "name": "Split Floats", "results": { "time": 683.7 } }, { "category": "Csharp > String Manipulation", "name": "Substr", "results": { "time": 24.12 } }, { "category": "Csharp > String Manipulation", "name": "To Camel Case", "results": { "time": 2317 } }, { "category": "Csharp > String Manipulation", "name": "To Lower", "results": { "time": 51.38 } }, { "category": "Csharp > String Manipulation", "name": "To Pascal Case", "results": { "time": 3692 } }, { "category": "Csharp > String Manipulation", "name": "To Snake Case", "results": { "time": 2765 } }, { "category": "Csharp > String Manipulation", "name": "To Utf 16 Buffer", "results": { "time": 60.21 } }, { "category": "Csharp > String Manipulation", "name": "To Utf 32 Buffer", "results": { "time": 268.5 } }, { "category": "Csharp > String Manipulation", "name": "To Utf 8 Buffer", "results": { "time": 34.16 } }, { "category": "Csharp > String Manipulation", "name": "Uri Decode", "results": { "time": 206.6 } }, { "category": "Csharp > String Manipulation", "name": "Uri Encode", "results": { "time": 274.9 } }, { "category": "Csharp > String Manipulation", "name": "Validate Node Name", "results": { "time": 179.5 } }, { "category": "Csharp > String Manipulation", "name": "Xml Escape", "results": { "time": 233.7 } }, { "category": "Csharp > String Manipulation", "name": "Xml Unescape", "results": { "time": 6.415 } } ], "engine": { "version": "v4.3.beta2.official", "version_hash": "b75f0485ba15951b87f1d9a2d8dd0fcd55e178e4" }, "system": { "cpu_architecture": "x86_64", "cpu_count": 12, "cpu_name": "AMD Ryzen 5 1600 Six-Core Processor", "os": "Linux" } }
GDScript benchmark results in comparison, on the same machine { "benchmarks": [ { "category": "Gdscript > Alloc", "name": "Deep Tree", "results": { "time": 336 } }, { "category": "Gdscript > Alloc", "name": "Duplicate", "results": { "time": 2356 } }, { "category": "Gdscript > Alloc", "name": "Fragmentation", "results": { "time": 4857 } }, { "category": "Gdscript > Alloc", "name": "Wide Tree", "results": { "time": 313.2 } }, { "category": "Gdscript > Binary Trees", "name": "Binary Trees 13", "results": { "time": 1075 } }, { "category": "Gdscript > Binary Trees", "name": "Binary Trees 15", "results": { "time": 5204 } }, { "category": "Gdscript > Hello World", "name": "Hello World", "results": { "time": 0.033 } }, { "category": "Gdscript > Lambda Performance", "name": "Lambda Call", "results": { "time": 127.9 } }, { "category": "Gdscript > Mandelbrot Set", "name": "Mandelbrot Set", "results": { "time": 10570 } }, { "category": "Gdscript > Merkle Trees", "name": "Merkle Trees 13", "results": { "time": 4396 } }, { "category": "Gdscript > Merkle Trees", "name": "Merkle Trees 15", "results": { "time": 22810 } }, { "category": "Gdscript > Nbody", "name": "Nbody 1 000 000", "results": { "time": 16800 } }, { "category": "Gdscript > Nbody", "name": "Nbody 500 000", "results": { "time": 8361 } }, { "category": "Gdscript > Spectral Norm", "name": "Spectral Norm 100", "results": { "time": 143.1 } }, { "category": "Gdscript > Spectral Norm", "name": "Spectral Norm 1000", "results": { "time": 13830 } }, { "category": "Gdscript > Spectral Norm", "name": "Spectral Norm 500", "results": { "time": 3386 } }, { "category": "Gdscript > String Checksum", "name": "Md 5 Buffer Empty", "results": { "time": 278.5 } }, { "category": "Gdscript > String Checksum", "name": "Md 5 Buffer Non Empty", "results": { "time": 935.2 } }, { "category": "Gdscript > String Checksum", "name": "Md 5 Text Empty", "results": { "time": 1038 } }, { "category": "Gdscript > String Checksum", "name": "Md 5 Text Non Empty", "results": { "time": 1699 } }, { "category": "Gdscript > String Checksum", "name": "Sha 1 Buffer Empty", "results": { "time": 301.7 } }, { "category": "Gdscript > String Checksum", "name": "Sha 1 Buffer Non Empty", "results": { "time": 959.9 } }, { "category": "Gdscript > String Checksum", "name": "Sha 1 Text Empty", "results": { "time": 1181 } }, { "category": "Gdscript > String Checksum", "name": "Sha 1 Text Non Empty", "results": { "time": 1854 } }, { "category": "Gdscript > String Checksum", "name": "Sha 256 Buffer Empty", "results": { "time": 523.9 } }, { "category": "Gdscript > String Checksum", "name": "Sha 256 Buffer Non Empty", "results": { "time": 1656 } }, { "category": "Gdscript > String Checksum", "name": "Sha 256 Text Empty", "results": { "time": 1807 } }, { "category": "Gdscript > String Checksum", "name": "Sha 256 Text Non Empty", "results": { "time": 2961 } }, { "category": "Gdscript > String Format", "name": "Complex Variable Concatenate", "results": { "time": 2795 } }, { "category": "Gdscript > String Format", "name": "Complex Variable Method", "results": { "time": 5753 } }, { "category": "Gdscript > String Format", "name": "Complex Variable Percent", "results": { "time": 5678 } }, { "category": "Gdscript > String Format", "name": "No Op Constant Method", "results": { "time": 227.2 } }, { "category": "Gdscript > String Format", "name": "Simple Constant Concatenate", "results": { "time": 16.29 } }, { "category": "Gdscript > String Format", "name": "Simple Constant Method", "results": { "time": 1197 } }, { "category": "Gdscript > String Format", "name": "Simple Constant Method Constant Dict", "results": { "time": 989.3 } }, { "category": "Gdscript > String Format", "name": "Simple Constant Percent", "results": { "time": 17.51 } }, { "category": "Gdscript > String Format", "name": "Simple Variable Concatenate", "results": { "time": 245.3 } }, { "category": "Gdscript > String Format", "name": "Simple Variable Method", "results": { "time": 1262 } }, { "category": "Gdscript > String Format", "name": "Simple Variable Percent", "results": { "time": 787 } }, { "category": "Gdscript > String Manipulation", "name": "Begins With", "results": { "time": 35.67 } }, { "category": "Gdscript > String Manipulation", "name": "Bigrams", "results": { "time": 981.2 } }, { "category": "Gdscript > String Manipulation", "name": "Capitalize", "results": { "time": 2635 } }, { "category": "Gdscript > String Manipulation", "name": "Casecmp To", "results": { "time": 31.32 } }, { "category": "Gdscript > String Manipulation", "name": "Contains", "results": { "time": 33.08 } }, { "category": "Gdscript > String Manipulation", "name": "Contains Gdscript In", "results": { "time": 15.72 } }, { "category": "Gdscript > String Manipulation", "name": "Count", "results": { "time": 320.1 } }, { "category": "Gdscript > String Manipulation", "name": "Countn", "results": { "time": 707.9 } }, { "category": "Gdscript > String Manipulation", "name": "Ends With", "results": { "time": 37.2 } }, { "category": "Gdscript > String Manipulation", "name": "Find", "results": { "time": 113.5 } }, { "category": "Gdscript > String Manipulation", "name": "Findn", "results": { "time": 142.2 } }, { "category": "Gdscript > String Manipulation", "name": "Get Slice", "results": { "time": 132.5 } }, { "category": "Gdscript > String Manipulation", "name": "Get Slice Count", "results": { "time": 80.41 } }, { "category": "Gdscript > String Manipulation", "name": "Humanize Size", "results": { "time": 1257 } }, { "category": "Gdscript > String Manipulation", "name": "Insert", "results": { "time": 328.7 } }, { "category": "Gdscript > String Manipulation", "name": "Is Valid Filename", "results": { "time": 1477 } }, { "category": "Gdscript > String Manipulation", "name": "Lpad", "results": { "time": 245.9 } }, { "category": "Gdscript > String Manipulation", "name": "Naturalnocasecmp To", "results": { "time": 34.03 } }, { "category": "Gdscript > String Manipulation", "name": "Nocasecmp To", "results": { "time": 63.98 } }, { "category": "Gdscript > String Manipulation", "name": "Pad Decimals", "results": { "time": 924 } }, { "category": "Gdscript > String Manipulation", "name": "Pad Decimals Pre Constructed", "results": { "time": 112.7 } }, { "category": "Gdscript > String Manipulation", "name": "Pad Zeros", "results": { "time": 630.5 } }, { "category": "Gdscript > String Manipulation", "name": "Pad Zeros Pre Constructed", "results": { "time": 363.1 } }, { "category": "Gdscript > String Manipulation", "name": "Rfind", "results": { "time": 98.27 } }, { "category": "Gdscript > String Manipulation", "name": "Rfindn", "results": { "time": 357.6 } }, { "category": "Gdscript > String Manipulation", "name": "Rpad", "results": { "time": 187 } }, { "category": "Gdscript > String Manipulation", "name": "Rsplit", "results": { "time": 633.8 } }, { "category": "Gdscript > String Manipulation", "name": "Similarity", "results": { "time": 961.3 } }, { "category": "Gdscript > String Manipulation", "name": "Simplify Path", "results": { "time": 2022 } }, { "category": "Gdscript > String Manipulation", "name": "Split", "results": { "time": 594.4 } }, { "category": "Gdscript > String Manipulation", "name": "Split Floats", "results": { "time": 419.2 } }, { "category": "Gdscript > String Manipulation", "name": "Substr", "results": { "time": 93.82 } }, { "category": "Gdscript > String Manipulation", "name": "To Camel Case", "results": { "time": 1681 } }, { "category": "Gdscript > String Manipulation", "name": "To Lower", "results": { "time": 384.4 } }, { "category": "Gdscript > String Manipulation", "name": "To Pascal Case", "results": { "time": 3011 } }, { "category": "Gdscript > String Manipulation", "name": "To Snake Case", "results": { "time": 2069 } }, { "category": "Gdscript > String Manipulation", "name": "To Utf 16 Buffer", "results": { "time": 169.7 } }, { "category": "Gdscript > String Manipulation", "name": "To Utf 32 Buffer", "results": { "time": 107.2 } }, { "category": "Gdscript > String Manipulation", "name": "To Utf 8 Buffer", "results": { "time": 181.2 } }, { "category": "Gdscript > String Manipulation", "name": "To Wchar Buffer", "results": { "time": 115.8 } }, { "category": "Gdscript > String Manipulation", "name": "Uri Decode", "results": { "time": 626 } }, { "category": "Gdscript > String Manipulation", "name": "Uri Encode", "results": { "time": 614.5 } }, { "category": "Gdscript > String Manipulation", "name": "Validate Filename", "results": { "time": 2623 } }, { "category": "Gdscript > String Manipulation", "name": "Validate Node Name", "results": { "time": 154.4 } }, { "category": "Gdscript > String Manipulation", "name": "Xml Escape", "results": { "time": 870.6 } }, { "category": "Gdscript > String Manipulation", "name": "Xml Unescape", "results": { "time": 111.2 } } ], "engine": { "version": "v4.3.beta2.official", "version_hash": "b75f0485ba15951b87f1d9a2d8dd0fcd55e178e4" }, "system": { "cpu_architecture": "x86_64", "cpu_count": 12, "cpu_name": "AMD Ryzen 5 1600 Six-Core Processor", "os": "Linux" } }