Skip to content

Performance Relational Components Performance

github-actions[bot] edited this page Apr 21, 2026 · 8 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.

How to refresh these tables:

  1. Open Unity’s Test Runner (EditMode/PlayMode as appropriate for your setup).
  2. Run RelationalComponentBenchmarkTests.Benchmark inside Tests/Runtime/Performance.
  3. The test logs the tables to the console and rewrites the section that matches the current operating system.

The script executes the benchmark test in batch mode, captures the markdown tables to BenchmarkLogs/RelationalBenchmark.log, and preserves the raw TestResults.xml when -KeepResults is specified.

Windows (Editor/Player)

Last updated 2026-04-21 03:19 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 743,472 5,713,435 0.13x 750,000
Parent - Array 448,986 3,369,056 0.13x 450,000
Parent - List 489,226 4,282,326 0.11x 490,000
Parent - HashSet 492,256 2,897,865 0.17x 500,000
Child - Single 493,912 3,549,388 0.14x 500,000
Child - Array 187,391 2,449,558 0.08x 190,000
Child - List 192,235 2,595,599 0.07x 200,000
Child - HashSet 194,009 1,705,553 0.11x 200,000
Sibling - Single 3,831,725 14,540,578 0.26x 3,840,000
Sibling - Array 704,704 2,604,095 0.27x 710,000
Sibling - List 841,554 3,152,693 0.27x 850,000
Sibling - HashSet 825,542 1,871,076 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.

Clone this wiki locally