Galaxy Shell / docs
Docs / Histórico

Initial performance baseline, 2026-10-27

openspec/changes/archive/2026-10-27-performance-baseline/design.md · Editar no GitHub ↗

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

Este documento registra decisões, planejamento ou evidências de uma etapa do projeto. Não implica que todos os itens estejam implementados ou validados na versão atual.

Nesta página

Initial performance baseline, 2026-10-27

Doc status: history. Dated measurement baseline of 2026-10-27, taken at commit ffa479f. Checked 2026-11-10.

This round combines observation of processes in the existing session with synthetic microbenchmarks of the core and of the renderer. It is not a full run of the acceptance matrix in performance. It does not measure input to pixel, physical FPS, GPU, cold start or retention over ten minutes. No optimization or runtime switch was applied.

Environment and scope

Machine: Intel Core i5-8265U, 4 cores/8 threads, about 7.64 GiB of RAM, Intel UHD Graphics 620, Linux 6.8.0-147-generic, governor powersave. The session found was direct Smithay DRM on GDM/TTY2, with a 1366×768 output and scale 1. The refresh rate was not inferred from the resolution alone.

The active checkout was at ffa479f, while the synthetic test uses the base 4a1a54f. The SHA-256 hashes of the seed JavaScript in the two trees and of the bundle served in the real profile matched: a58b366672db50b437c3a4d76166d8b1caf8134292f4a5527ce472ee6b98db15. This identifies the renderer, but it does not make the hosts or the whole release identical. The active Electron was 45.0.0, and its arguments included --no-sandbox. The measurement describes this existing configuration, without recommending or changing its protections.

Session observation

The reproducible collector lives in scripts/benchmark-processes.py. After discovering the current PIDs, run python3 scripts/benchmark-processes.py --tree PID_ELECTRON --single PID_SMITHAY. Do not reuse historical PIDs. The first test used an equivalent temporary version. The versioned collector already returns null CPU when the tree changes.

The test used three consecutive windows of 60 s, reading /proc at the start and at the end. The Electron tree includes its children, the core and subprocesses. Smithay is measured separately. A CPU of 100% matches one logical processor, not the whole machine. PSS adds the proportional share of shared pages. Values are snapshots at the end of each interval, not peaks. Comparing PIDs and creation time detects a change in the processes present at the endpoints, but it does not identify transient processes that start and end between samples.

The session was in use, with external applications and the client of this conversation open. Therefore, the result is observational and must not be called minimum idle consumption. The synthetic benchmarks started only after these three windows. No host/compositor was restarted or created for this observation.

Interval Electron, CPU (% of one core) Electron, PSS (MiB) Smithay, CPU (% of one core) Smithay, PSS (MiB)
1 18.07 525.26 9.49 18.42
2 21.19 471.92 7.51 18.42
3 Discarded: tree changed 463.93 (different tree) 7.92 12.43

The Electron tree had 11 processes in the first two intervals and 13 at the end of the third. The CPU of the third interval does not account correctly for new or ended processes, so it is not part of the analysis. PSS is still the snapshot of the processes present at that moment. The third snapshot is not directly comparable to the previous two. The identities of the main host, the core and the compositor were preserved. The PSS decrease does not prove the absence of a leak or an improvement: it includes a change in the composition of the tree and the memory behavior of the system.

A read query to the real state returned 265,200 bytes, of which 233,224 bytes were the three UI assets. The core was ready and had no turn in progress at that moment. Content and credentials were not saved. The bundle is about 88% of this specific payload. With a nominal interval of 600 ms, this would be about 432 KiB/s per client for this JSON body alone, if all queries happened at this rate and with a constant size. This is an arithmetic projection, not captured traffic. It does not include headers or additional clients.

Core microbenchmark

Reproducible run from web-shell/:

node scripts/benchmark-performance.js > /tmp/performance-core.json

The script does not start OpenCode, the compositor or Electron, and it does not read the real profile. It generates synthetic messages of 1,024 ASCII characters plus metadata and 0, 8 or 16 small static surfaces. The generation of the fixture stays outside the measured times. It measures separately JSON stringify/parse, the public projection with surfaceDocument, structuredClone and the real Store.save(), including atomic write and sync, in a temporary directory that is removed at the end.

The test payload approximates the dominant part of /api/state, with one conversation and the real bundle, but it omits models, account, compositor and other fields. It is not an HTTP benchmark, it does not include provider events and it does not measure the concurrent write queue. There are three repetitions per combination. JSON/projection/clone have 100 samples per repetition, reduced to 20 for 10,000 messages. Writing has 20 samples, reduced to 5 at the largest load. Up to ten warm-ups precede each operation. Percentiles of small groups are exploratory. The larger write is reported by median and maximum, without a strong interpretation of p95.

Node v24.19.0. Table: median of the medians of the three repetitions, in ms, with 16 static surfaces.

1 KB messages JSON (bytes) Stringify Parse Projection Clone Durable save
0 244169 0.484 0.349 0.041 0.028 7.567
100 350509 0.650 0.436 0.038 0.110 9.978
1000 1308559 2.195 1.251 0.045 1.040 29.389
10000 10898059 20.649 10.261 0.051 14.545 74.944

The projection of small surfaces stayed cheap at this load. The strongest growth appeared in the transport/copy of the history and in the full persistence. This does not test inline documents close to the size limit or animated scripts.

10,000 messages + 16 surfaces p95 range per repetition (ms) Largest observation (ms)
stringify 20.802 to 26.800 30.849
parse 13.586 to 15.835 18.011
projection 0.046 to 0.100 0.111
clone 16.817 to 28.340 29.147

Save at this load: medians per repetition of 70.316 ms, 1,042.414 ms and 74.944 ms. The maximum observed was 1,185.215 ms, with only five measured samples per repetition. One whole repetition was slow, so the value of 74.944 ms in the table does not represent the variability by itself. The test does not identify the cause of this difference. Do not extrapolate it to UI latency: the core is separate, and part of this time is asynchronous waiting for storage.

Renderer microbenchmark in the browser

Reproducible run:

cd web-shell
node scripts/benchmark-performance.js --browser

Open the loopback URL that the script prints, keep the tab visible, wait for DONE 36 cases and end the server when finished. Aggregated results go to stdout, with no real data. The harness uses the real React bundle in an opaque iframe, without a core or provider. Each fixture is built only when needed, which avoids embedding all the loads in the initial document.

There are three repetitions of the 12 combinations. Each combination switches the conversation, waits 100 ms, runs ten warm-up updates and times 100 synchronous onState calls with objects cloned before the timer starts. The updates repeat unchanged content to represent the waste identified in the polling. The 10 ms interval plus the wait for requestAnimationFrame is an accelerated load, different from the 600 ms cadence of the product. The measured time excludes cloning, HTTP and state construction. It includes the synchronous React/DOM work and the layout reads that the callback makes.

The wait for the rAF callback is also recorded, with 100 samples per combination. This value is only browser scheduling. It is not proof of painting, composition, FPS or physical latency. The switch/mount time includes unmounting the previous conversation when one exists. It does not wait for the iframes to finish loading, and it does not represent the total time until the components are usable. Data for animated components, real interaction and prolonged memory stay pending.

Browser reported by the harness: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36. It is not the Electron host of the product. All 36 combinations ended with visible visibility in the final record of each case and with the expected counts of articles/iframes. The UI showed DONE 36 cases.

Messages Surfaces Median of update medians (ms) p95 range across repetitions (ms) Maximum (ms)
0 0 0.10 0.30 to 0.30 0.50
0 16 0.30 0.50 to 0.70 1.00
100 0 0.70 0.90 to 1.80 6.80
100 16 0.90 1.40 to 2.20 3.60
1000 0 5.30 7.50 to 9.60 19.40
1000 16 5.90 8.80 to 10.30 18.30
10000 0 67.00 85.40 to 173.50 355.50
10000 16 60.20 71.60 to 135.80 311.00

The cases with 8 surfaces were also run, which completes the 12 combinations per repetition. Values above 16.7 ms show synchronous work larger than a 60 Hz frame budget at this load. They are not the same as a measurement of FPS or typing latency. The load of 10,000 messages is a stress test, and the maximums also reflect variation in the shared session.

Switch/mount of 10,000 messages + 16 surfaces, per repetition: 3147.5 ms, 2959.7 ms, 3196.4 ms. This interval includes unmounting the previous case. It is not the startup time of the application.

The wait for rAF varied and is not used to state the presentation cadence. There was no GPU tracing and no control over the load of other applications. The collection is limited to the synthetic seed bundle. This harness did not exercise the full custom UI or the host controls.

Interpretation and next steps

The results do not allow adding up medians of microbenchmarks and presenting them as end-to-end latency. The observation of the compositor CPU does not separate its own cost, the load of the applications and the wait for the GPU. Before changing the DRM backend, profiling of presentation and synchronization on real hardware is necessary.

The implementation priority stays to reduce the retransmitted state and the React commits with no change, while preserving the synchronous preview, reconnection and the state of the inline components. After that, repeat the same load to get a before/after comparison. Publishing the documentation and the scripts does not update the runtime of the session.

Verification and review

The subagent gpt-6-luna, with high reasoning, reviewed the methodology and checked the tables against the aggregated JSON files. The review led to generating fixtures per case, raising the rAF samples, reducing iterations at the large loads and exposing the persistence variation between repetitions. The final check found no calculation error or extrapolation that needed a fix.

format:check, check and the 113 tests passed. The Python collector passed compilation and a short read run. The harness UI confirmed 36 completed cases. Browser proof: synthetic microbenchmark of the renderer. Electron proof: observation of existing processes, without instrumented interaction. System proof: identification of the compositor and consumption through /proc, without a measurement of presentation or window control. The PIDs of the main host, the core and the compositor stayed the same at the end. The temporary server and the test tab were ended.

Raw results and QA data stayed outside Git. Only reproducible scripts, aggregates and interpretation were versioned.