Skip to content

Performance Relational Components Performance

github-actions[bot] edited this page Sep 14, 2026 · 12 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-09-14 05:38 UTC on Windows 11 (10.0.26200).

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 1,239,795 10,018,690 0.12x 1,240,000
Parent - Array 746,056 4,764,392 0.16x 750,000
Parent - List 802,040 7,396,326 0.11x 810,000
Parent - HashSet 777,660 3,955,524 0.20x 780,000
Child - Single 665,079 5,341,149 0.12x 670,000
Child - Array 293,349 3,229,543 0.09x 300,000
Child - List 285,215 3,783,105 0.08x 290,000
Child - HashSet 300,276 2,001,901 0.15x 310,000
Sibling - Single 4,636,847 28,450,407 0.16x 4,640,000
Sibling - Array 1,242,712 3,361,155 0.37x 1,250,000
Sibling - List 1,339,612 4,176,273 0.32x 1,340,000
Sibling - HashSet 1,260,522 2,255,225 0.56x 1,270,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