Skip to content

Performance Reflection Performance

github-actions[bot] edited this page Apr 21, 2026 · 9 revisions

Reflection Performance Benchmarks

Unity Helpers replaces ad-hoc reflection with cached delegates that favour expression lambdas on IL2CPP-safe platforms and fall back to dynamic IL emit or plain reflection where available. These benchmarks compare raw System.Reflection against the helpers for common access patterns.

Each run updates the table for the current operating system only. Sections that still show _No benchmark data generated yet._ simply have not been executed on that platform.

Windows

Generated on 2026-04-21 03:18:51 UTC

Strategy: Default (auto)

Boxed Access (object)

Scenario Helper (ops/sec) System.Reflection (ops/sec) Speedup vs Reflection
Instance Field Get (boxed) 19.47M 7.32M 2.66x
Instance Field Set (boxed) 22.97M 5.36M 4.29x
Static Field Get (boxed) 21.28M 8.60M 2.47x
Static Field Set (boxed) 22.91M 6.17M 3.71x
Instance Property Get (boxed) 22.97M 22.71M 1.01x
Instance Property Set (boxed) 21.46M 2.05M 10.46x
Static Property Get (boxed) 18.58M 21.19M 0.88x
Static Property Set (boxed) 23.44M 2.90M 8.08x
Instance Method Invoke (boxed) 17.65M 1.95M 9.05x
Static Method Invoke (boxed) 23.10M 2.73M 8.46x
Constructor Invoke (boxed) 22.93M 1.67M 13.76x

Typed Access (no boxing)

Scenario Helper (ops/sec) Baseline Delegate (ops/sec) System.Reflection (ops/sec) Speedup vs Delegate Speedup vs Reflection
Instance Field Get (typed) 612.73M 660.71M 7.32M 0.93x 83.65x
Instance Field Set (typed) 630.08M 664.60M 5.36M 0.95x 117.65x
Static Field Get (typed) 625.63M 691.62M 8.60M 0.90x 72.76x
Static Field Set (typed) 636.30M 667.62M 6.17M 0.95x 103.16x
Instance Property Get (typed) 577.76M 695.19M 22.71M 0.83x 25.44x
Instance Property Set (typed) 638.69M 702.42M 2.05M 0.91x 311.50x
Static Property Get (typed) 619.33M 691.17M 21.19M 0.90x 29.23x
Static Property Set (typed) 616.60M 663.40M 2.90M 0.93x 212.58x
Instance Method Invoke (typed) 631.97M 687.16M 1.95M 0.92x 323.96x
Static Method Invoke (typed) 599.89M 673.32M 2.73M 0.89x 219.80x

Strategy: Expressions

Boxed Access (object)

Scenario Helper (ops/sec) System.Reflection (ops/sec) Speedup vs Reflection
Instance Field Get (boxed) 2.93M 3.44M 0.85x
Instance Field Set (boxed) 23.08M 5.34M 4.32x
Static Field Get (boxed) 21.30M 8.73M 2.44x
Static Field Set (boxed) 22.56M 6.19M 3.65x
Instance Property Get (boxed) 22.98M 20.58M 1.12x
Instance Property Set (boxed) 21.59M 2.07M 10.41x
Static Property Get (boxed) 18.91M 23.05M 0.82x
Static Property Set (boxed) 24.11M 2.94M 8.21x
Instance Method Invoke (boxed) 17.94M 1.97M 9.12x
Static Method Invoke (boxed) 23.96M 2.69M 8.89x
Constructor Invoke (boxed) 23.29M 2.60M 8.94x

Typed Access (no boxing)

Scenario Helper (ops/sec) Baseline Delegate (ops/sec) System.Reflection (ops/sec) Speedup vs Delegate Speedup vs Reflection
Instance Field Get (typed) 633.60M 673.55M 3.44M 0.94x 184.07x
Instance Field Set (typed) 639.86M 666.50M 5.34M 0.96x 119.77x
Static Field Get (typed) 624.14M 691.82M 8.73M 0.90x 71.50x
Static Field Set (typed) 620.62M 667.19M 6.19M 0.93x 100.32x
Instance Property Get (typed) 575.01M 697.98M 20.58M 0.82x 27.95x
Instance Property Set (typed) 637.80M 700.31M 2.07M 0.91x 307.44x
Static Property Get (typed) 617.42M 692.17M 23.05M 0.89x 26.78x
Static Property Set (typed) 620.64M 662.68M 2.94M 0.94x 211.39x
Instance Method Invoke (typed) 632.39M 691.15M 1.97M 0.91x 321.63x
Static Method Invoke (typed) 615.24M 685.00M 2.69M 0.90x 228.36x

Strategy: Dynamic IL

Boxed Access (object)

Scenario Helper (ops/sec) System.Reflection (ops/sec) Speedup vs Reflection
Instance Field Get (boxed) 23.15M 7.39M 3.13x
Instance Field Set (boxed) 24.84M 5.47M 4.54x
Static Field Get (boxed) 22.17M 8.73M 2.54x
Static Field Set (boxed) 24.27M 5.26M 4.61x
Instance Property Get (boxed) 25.16M 23.28M 1.08x
Instance Property Set (boxed) 22.48M 1.85M 12.12x
Static Property Get (boxed) 3.80M 2.18M 1.74x
Static Property Set (boxed) 24.76M 2.94M 8.43x
Instance Method Invoke (boxed) 19.77M 1.98M 9.98x
Static Method Invoke (boxed) 23.00M 2.68M 8.59x
Constructor Invoke (boxed) 22.50M 2.61M 8.63x

Typed Access (no boxing)

Scenario Helper (ops/sec) Baseline Delegate (ops/sec) System.Reflection (ops/sec) Speedup vs Delegate Speedup vs Reflection
Instance Field Get (typed) 614.97M 674.10M 7.39M 0.91x 83.27x
Instance Field Set (typed) 639.26M 664.73M 5.47M 0.96x 116.85x
Static Field Get (typed) 617.13M 692.64M 8.73M 0.89x 70.67x
Static Field Set (typed) 635.79M 667.62M 5.26M 0.95x 120.86x
Instance Property Get (typed) 587.73M 695.70M 23.28M 0.84x 25.25x
Instance Property Set (typed) 638.85M 702.14M 1.85M 0.91x 344.41x
Static Property Get (typed) 618.98M 692.84M 2.18M 0.89x 284.05x
Static Property Set (typed) 615.38M 657.24M 2.94M 0.94x 209.61x
Instance Method Invoke (typed) 621.08M 679.85M 1.98M 0.91x 313.60x
Static Method Invoke (typed) 608.12M 683.73M 2.68M 0.89x 227.17x

Strategy: Reflection Fallback

Boxed Access (object)

Scenario Helper (ops/sec) System.Reflection (ops/sec) Speedup vs Reflection
Instance Field Get (boxed) 7.01M 7.40M 0.95x
Instance Field Set (boxed) 5.52M 3.73M 1.48x
Static Field Get (boxed) 8.18M 8.73M 0.94x
Static Field Set (boxed) 5.92M 4.33M 1.37x
Instance Property Get (boxed) 21.09M 21.88M 0.96x
Instance Property Set (boxed) 2.05M 2.10M 0.98x
Static Property Get (boxed) 16.46M 22.90M 0.72x
Static Property Set (boxed) 2.93M 2.99M 0.98x
Instance Method Invoke (boxed) 2.01M 1.99M 1.01x
Static Method Invoke (boxed) 2.69M 2.73M 0.99x
Constructor Invoke (boxed) 2.23M 1.62M 1.38x

Typed Access (no boxing)

Scenario Helper (ops/sec) Baseline Delegate (ops/sec) System.Reflection (ops/sec) Speedup vs Delegate Speedup vs Reflection
Instance Field Get (typed) 6.77M 669.47M 7.40M 0.01x 0.91x
Instance Field Set (typed) 5.52M 659.03M 3.73M 0.01x 1.48x
Static Field Get (typed) 8.03M 686.98M 8.73M 0.01x 0.92x
Static Field Set (typed) 3.90M 669.93M 4.33M 0.01x 0.90x
Instance Property Get (typed) 576.71M 695.18M 21.88M 0.83x 26.36x
Instance Property Set (typed) 638.85M 701.32M 2.10M 0.91x 303.61x
Static Property Get (typed) 609.05M 680.50M 22.90M 0.90x 26.59x
Static Property Set (typed) 609.89M 652.01M 2.99M 0.94x 203.85x
Instance Method Invoke (typed) 630.49M 687.37M 1.99M 0.92x 317.05x
Static Method Invoke (typed) 611.20M 683.09M 2.73M 0.89x 224.12x

macOS

No benchmark data generated yet.

Linux

No benchmark data generated yet.

Unknown / Other

No benchmark data generated yet.

Clone this wiki locally