Skip to content

ci(audience): capture Unity 6 deep profiler dump on Linux#764

Closed
ImmutableJeffrey wants to merge 1 commit intochore/sdk-318-linux-playmode-xvfbfrom
chore/audience-linux-perf-profile
Closed

ci(audience): capture Unity 6 deep profiler dump on Linux#764
ImmutableJeffrey wants to merge 1 commit intochore/sdk-318-linux-playmode-xvfbfrom
chore/audience-linux-perf-profile

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

Summary

  • Adds -profiler-enable -deepprofiling -profiler-log-file to the Unity invocation in playmode-linux, gated to Unity 6 cells only.
  • Uploads profile.raw as an artifact alongside existing playmode artifacts.

Why

Unity 6 Linux cells take roughly 7x longer than Unity 2021.3 on the same SampleApp and same software rasteriser. Cause unknown. The capture lets us see per-frame and per-call costs.

How to use the capture

Download profile.raw, open Unity Editor on the same project, Window > Analysis > Profiler, "Load" the file. Inspect CPU usage by frame to find the cost centre.

🤖 Generated with Claude Code

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator Author

Closing without merging. Profile capture served its purpose. Findings: Unity 6 Linux cells are bottlenecked on per-frame UI Toolkit cost on llvmpipe combined with frame-paced test polling (yield return null per check). Each WaitForLogEntry spin happens at the player's frame rate, which is 1-2 fps on llvmpipe. 39 tests x ~30 sec WaitForLogEntry budget = the 27 min cell time. Pursuing the targeted fix (time-based polling in test helpers) in a new PR.

ImmutableJeffrey added a commit that referenced this pull request May 9, 2026
…runs

Adds PlayerProfilerLogger gated on UNITY_STANDALONE_LINUX and the
AUDIENCE_PLAYER_PROFILE_PATH env var. At BeforeSceneLoad inside the
test player process, points UnityEngine.Profiling.Profiler at the
configured path and starts a binary log of every captured frame.

PR #764 captured a deep profile of the editor process. The actual test
loop runs in a separate PlayerWithTests subprocess that the editor
launches and waits on. The editor profile only showed roughly 86 sec
of editor activity over a 27 min cell, the rest being editor idle
waiting on the player. This hook plugs that gap.

Wires the env var through the playmode-linux job's docker run and
adds player-profile.raw to the upload-artifact path so the capture is
downloadable for offline analysis in Unity Editor.

Note: enables regular profiling, not deep. Deep profiling on the
player would need -deepprofiling on the player command line, which
Unity Test Framework does not expose for editor-launched test
players. Regular profiling still surfaces per-frame CPU and the
function hot list, which is what we need to identify what is eating
roughly 37 sec per test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant