Galaxy Shell / docs
Docs / Arquitetura e desenvolvimento

Performance: React, Electron and Smithay

openspec/specs/performance/spec.md · Editar no GitHub ↗

Esta página ainda não tem tradução em português. O conteúdo abaixo está em inglês.

Nesta página

Performance: React, Electron and Smithay

Purpose

Records a measurement protocol and the frame timing log for judging the performance of the React, Electron and Smithay stack, without promising a frame rate on any hardware.

Requirements

Requirement: Record the environment

A measurement SHALL record the commit and bundle actually loaded, the Electron/Chromium and Smithay versions, the hardware (CPU, RAM, GPU/driver), kernel, resolution, scale, Hz, power mode, the nested or DRM backend, the profile and the process tree; an updated checkout does not prove an updated runtime. Full text: section Measurement protocol.

Scenario: Record the environment

  • WHEN a measurement run starts
  • THEN the commit, bundle, versions, hardware and backend are recorded first

Requirement: Synthetic data

Measurements SHALL use reproducible synthetic data (an empty conversation; 100, 1,000 and 10,000 messages of about 1 KB; 0, 8 and 16 inline components) and SHALL record the number of inactive conversations and total messages; these values are test loads, not promised capacities. Full text: section Measurement protocol.

Scenario: Synthetic data

  • WHEN a scenario needs a long conversation
  • THEN a synthetic conversation of a stated size is used, not real data

Requirement: Sample sizes and cold starts

Each scenario SHALL warm up for 30 s, record for 60 s and repeat at least three times; p95 SHALL need at least 100 interactions and p99 from small samples SHALL be treated as exploratory only; startup SHALL need a separate series of at least ten starts; shared system caches SHALL NOT be cleared to fabricate a cold start. Full text: section Measurement protocol.

Scenario: Sample sizes and cold starts

  • WHEN a p99 is computed from a small sample
  • THEN it is treated as exploratory only

Requirement: Proxies are not proof

requestAnimationFrame and DOM measurement SHALL be treated as proxies, not proof of physical presentation, and a static screenshot SHALL be treated as proof of appearance, not of latency or fluidity. Full text: section Measurement protocol.

Scenario: Proxies are not proof

  • WHEN a requestAnimationFrame timing is reported
  • THEN it is labeled a proxy and not proof of presentation

Requirement: Provider use

The deterministic test without a provider SHALL be separate from the experience with a real provider; the authorized provider SHALL be used only when necessary and never a paid fallback, and network and model variation SHALL NOT be attributed to the renderer. Full text: section Measurement protocol.

Scenario: Provider use

  • WHEN a measurement needs a real provider
  • THEN only the authorized provider is used and its variation is kept apart from the renderer

Requirement: Comparing runs

Baseline and candidate SHALL be compared under the same load, an improvement SHALL NOT be declared when the difference is within the observed variation, and open/close/switch cycles SHALL be repeated for at least ten minutes to investigate growing memory retention. Full text: section Measurement protocol.

Scenario: Comparing runs

  • WHEN a candidate differs from the baseline by less than the observed variation
  • THEN no improvement is declared

Requirement: Interventions need coordination

This document SHALL NOT authorize restarting the runtime, ending the session, opening another host/compositor or starting a nested session; an intervention in the existing session SHALL first discover the session, processes, profile and sockets and read the coordination log and lock. Traces, captures and QA data SHALL stay out of Git and SHALL NOT contain real conversations or credentials. Full text: section Measurement protocol.

Scenario: Interventions need coordination

  • WHEN a measurement would need to restart the runtime
  • THEN the protocol does not authorize it

Requirement: Frame timing log

With RUST_LOG=frame_timing=info the compositor SHALL log the duration of each phase of the render loop every two seconds, in the nested and in the DRM backend. Full text: section Frame timing of the render loop.

Scenario: Frame timing log

  • WHEN the compositor runs with RUST_LOG=frame_timing=info
  • THEN it logs each render-loop phase duration every two seconds

Status

Doc status: partly landed. Static analysis of 2026-10-27 with a measurement protocol. Landed: the first fixes (openspec/changes/archive/2026-10-27-performance-fixes/design.md) and later overview work. Not landed: most listed proposals. Uncertain: which proposals landed individually. Checked 2026-11-10.

Introduction

Evaluation of 2026-10-27, based on the code of commit c81432d. This document records static analysis, proposed targets and a measurement protocol. The first round of measurements is in a separate document, with validity limits; there is no promise of a given frame rate on the user's hardware.

Measurement protocol

  1. Record the commit and bundle actually loaded, Electron/Chromium and Smithay versions, CPU, RAM, GPU/driver, kernel, resolution, scale, Hz and power mode. Identify nested or DRM backend, profile and process tree. An updated checkout does not prove an updated runtime.
  2. Use reproducible synthetic data: empty conversation; 100, 1,000 and 10,000 messages of about 1 KB; 0, 8 and 16 inline components per conversation (respecting the current publishing limit) with fixed content; separate static components from animated ones. Record the number of inactive conversations and total messages, because the current transport includes all of them. These values are test loads, not promised capacities.
  3. Exercise typing, scroll, conversation switch, palette, panel open/close, window movement and overview, only where implemented. Repeat with static and animated external applications. Test components outside the visible area and hidden chat without assuming suspension.
  4. For each scenario, warm up for 30 s, record for 60 s and repeat at least three times. Gather at least 100 interactions for p95; treat p99 from small samples as exploratory only. Startup needs a separate series of at least ten starts, telling warm cache from cold. Do not clear shared system caches to fabricate a cold start.
  5. Use Chromium/DevTools traces for JS, layout, paint, long tasks and transport; record the duration and volume of /api/state. Measure CPU per process and in total, stating whether 100% equals one core. Prefer PSS to add up memory on Linux; RSS can count shared pages repeatedly. Record GPU/VRAM separately when available.
  6. Instrument input, sending to the compositor and presentation with correlated clocks, or use suitable external capture for input-to-pixel. requestAnimationFrame and DOM measurement are proxies, not proof of physical presentation. A static screenshot proves appearance, not latency or fluidity. Record the overhead of the instruments and confirm results without DevTools open when possible.
  7. Separate the deterministic test without a provider from the experience with a real provider. Use the authorized provider only when necessary; never a paid fallback. Measure first text, completion and local overhead separately. Do not attribute network and model variation to the renderer.
  8. Compare baseline and candidate under the same load, preferably interleaving the runs. Do not declare an improvement if the difference is within the observed variation. Repeat open/close/switch cycles for at least ten minutes to investigate growing memory retention.

Interventions in the existing session require current discovery of the session, processes, profile and sockets, plus reading the coordination log and lock, as set out in AGENTS.md and project-loading. This document does not authorize restarting the runtime, ending the session, opening another host/compositor or starting a nested session. Isolated synthetic core tests stay subject to the project rules. Traces, captures and QA data stay out of Git and must not contain real conversations or credentials.

Frame timing of the render loop

RUST_LOG=frame_timing=info makes the compositor log the duration of each phase of the render loop every two seconds, in the nested and in the DRM backend. The first use, on the workspaces overview, is in the overview record.