Skip to content

Performance Relational Components Performance

github-actions[bot] edited this page Aug 26, 2026 · 10 revisions

Relational Component Performance Benchmarks

Relational component attributes ([SiblingComponent], [ParentComponent], [ChildComponent]) remove repetitive GetComponent* code. These benchmarks quantify the runtime cost of calling Assign*Components for common field shapes (single component, array, List<T>, and HashSet<T>) against hand-written lookups.

Numbers below are grouped by operating system. A section reading pending means nobody has run this suite on that platform, not that the attributes are slow there.

Windows (Editor/Player)

Last updated 2026-05-08 04:09 UTC on Windows 11 (10.0.26200) 64bit.

Numbers capture repeated Assign*Components calls for one second per scenario. Higher operations per second are better.

Operations per second (higher is better)

Scenario Relational Ops/s Manual Ops/s Rel/Manual Iterations
Parent - Single 727,869 5,749,952 0.13x 730,000
Parent - Array 445,375 3,343,147 0.13x 450,000
Parent - List 491,299 4,194,708 0.12x 500,000
Parent - HashSet 479,674 2,949,101 0.16x 480,000
Child - Single 496,367 3,564,321 0.14x 500,000
Child - Array 187,832 2,392,107 0.08x 190,000
Child - List 193,706 2,594,739 0.07x 200,000
Child - HashSet 194,977 1,728,196 0.11x 200,000
Sibling - Single 3,797,711 14,448,211 0.26x 3,800,000
Sibling - Array 687,153 2,578,904 0.27x 690,000
Sibling - List 838,603 3,380,690 0.25x 840,000
Sibling - HashSet 826,435 1,872,130 0.44x 830,000

macOS

Pending — run the relational component benchmark suite on macOS to capture results.

Linux

Pending — run the relational component benchmark suite on Linux to capture results.

Other Platforms

Pending — run the relational component benchmark suite on the target platform to capture results.

Refreshing these numbers

Run RelationalComponentBenchmarkTests.Benchmark from Unity's Test Runner. It rewrites the section matching the operating system it ran on and leaves the others alone.

Clone this wiki locally