Stop redrawing an unchanged desktop; faster fills and blits; --profile
CI / test (push) Failing after 31s

Profiling the wasm compositor at 1080p idle: ~90 ms per frame in the software rasteriser, run
every loop iteration (92% of a core, stuttery). Now:
- compose_frame compares what the frame is made from (shell ops, decorations, popups, client
  damage) with the last one and returns the previous pixels when nothing changed; the DRM and
  nested loops only present a changed frame (held until the display is ready).
- fill_rounded_rect fills spans (circle test only in the corner bands) and blit_shm_surface
  copies rows without per-pixel calls; tests check both against the old per-pixel code.
- snapshot_shm_buffer sliced buffers byte by byte; now a slice copy.
- --profile prints per-3s step / shell / raster timings.
Idle CPU at 1080p: 92% -> ~10%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 03:35:06 -08:00
1 parent 235f17cd70
commit 095bbc5906
6 files changed
+303 -36

No files matched your search

+3 -5
View File
@@ -390,14 +390,12 @@ fn snapshot_shm_buffer(
return None
}
let byte_len = buf.stride * buf.height
// The buffer's bytes within the pool: a slice copy, not a byte-by-byte loop (a full-screen
// buffer is 8 MB and this runs on every commit).
let slice = if buf.offset == 0 && raw.length() == byte_len {
raw
} else {
let arr : Array[Byte] = Array(capacity=byte_len)
for i = 0; i < byte_len; i = i + 1 {
arr.push(raw[buf.offset + i])
}
Bytes::from_array(arr)
raw[buf.offset:buf.offset + byte_len].to_bytes()
}
Some({
width: buf.width,