Skip to content

Performance

github-actions[bot] edited this page Sep 14, 2026 · 10 revisions

Performance

Performance documentation is organized by measurement method and subsystem, not by pull-request number.

Start here

Goal Page
Run or review a trustworthy performance comparison [[Performance Methodology
Understand CPU/vCPU hot paths [[CPU & vCPU Execution
Understand timer/wakeup costs [[Clocks & Timers
Understand shared graphics work [[NV2A Graphics Architecture
Investigate Vulkan-specific costs [[Vulkan Performance
Compare OpenGL and Vulkan behavior [[OpenGL vs Vulkan

Performance layers

A frame or guest-progress interval can contain work from multiple independent systems:

flowchart LR
    A[vCPU / TCG] --> B[Guest device interaction]
    B --> C[PFIFO / PGRAPH]
    C --> D[Renderer CPU work]
    D --> E[Host GPU work]
    E --> F[Synchronization / completion]
    F --> G[Presentation / guest-visible progress]
Loading

An optimization is only useful if it reduces the total dependency that matters to the workload. Moving a wait from draw_flush to report retirement, or moving shader work from xemu into a driver call, is not automatically a net improvement.

Primary regions to classify

Region Examples
CPU execution Generated guest code, TB lookup/dispatch, translation, TLB/memory helpers
Device/timing MMIO, timer-list work, callbacks, IRQ transitions, host wait precision
Shared NV2A Pushbuffer parsing, PGRAPH state changes, texture/surface decisions
OpenGL renderer Program binding, GL state churn, surface readback, glFinish, driver CPU time
Vulkan renderer Shader compilation, pipeline creation, descriptors, render-pass lifetime, barriers, queue/fence waits
Presentation GPU selection, shared external memory, host-copy transport, VSync/compositor effects

Measurements are not interchangeable

The following can all be useful, but answer different questions:

  • Host CPU samples.
  • Host GPU timestamp spans.
  • Guest frame intervals.
  • NV2A display-write cadence.
  • Report/query completion cadence.
  • Presented host FPS.
  • XISO test duration.

A result must state which one it uses. For example, NV2A display writes are a guest-progress proxy, not proof of host-presented FPS.

Fidelity-aware profiling

Before treating a hot or cold subsystem as representative of Xbox hardware cost, classify its emulation boundary.

flowchart TD
    A[Measured host cost] --> B{What produced it?}
    B --> C[Guest architectural work]
    B --> D[Emulator translation/bookkeeping]
    B --> E[Host API/driver work]
    B --> F[Approximation/stub with omitted hardware work]
    B --> G[Compatibility workaround]
    C --> H[Potential guest workload bottleneck]
    D --> I[Potential emulator optimization]
    E --> J[Host-backend / synchronization investigation]
    F --> K[Do not infer physical hardware cost]
    G --> L[Preserve workaround semantics before optimizing]
Loading

Examples: synchronous SMBus makes board-management transactions artificially cheap relative to bit-level hardware timing; SDL queue pacing can make APU waits host-dependent; a register-only video encoder omits major physical work; Vulkan pipeline creation can make a guest state transition expensive for reasons that do not exist as a Vulkan concept on NV2A.

See Hardware Fidelity & Emulation Boundaries.

Research pages

The current Vulkan research sequence remains documented in depth:

  1. Shader Binding & Compilation — classify synchronous shader/module/pipeline work.
  2. Ubershader & Hybrid Specialization — research a fallback path for genuinely unseen specialization.
  3. Vertex Uploads & Render-Pass Lifetime — reason about buffer freshness, ordered copies, pass splitting, and synchronization.

These are architecture/performance investigations, not a list of automatically accepted optimizations. Current PR state is summarized under Development.

Debugging lag and hot paths

Debugging Lag & Hot Paths documents the practical investigation path used in this fork: optimized Release reproduction, matched DWARF symbolization, broad thread/hot-path attribution, narrow diagnostic instrumentation, and uninstrumented Release A/B acceptance.

Clone this wiki locally