Skip to content

docs(perf): Rank P1 hypotheses from CLT profiles - #10

Draft
harshabala wants to merge 1 commit into
perf/p0-hygiene-baselinefrom
perf/p1-instruments
Draft

harshabala wants to merge 1 commit into
perf/p0-hygiene-baselinefrom
perf/p1-instruments

Conversation

@harshabala

Copy link
Copy Markdown
Owner

P1 is read-only: rank hypotheses A–N. Playback, config schema, and user settings are unchanged.

This machine has Command Line Tools, not full Xcode, so Time Profiler / Allocations / Energy Log / System Trace did not run. The ranking uses top, footprint, sample(1), heap, and vmmap on the isolated harness. powermetrics still needs sudo.

Stacked on #9 (perf/p0-hygiene-baseline).

BEFORE (P0 budget clip)

1080p30 HEVC silent, isolated 30 s: idle 0.0% / 14 MB, playing ~5% / 21 MB, paused 0.13% / 20 MB. Playing already misses the 1.5% CPU budget. Wake-ups and Energy Impact were blank.

AFTER (P1 fixture comparison, 2026-10-14, Apple M1)

Run CPU avg (steady) footprint
Idle 45 s 0.0 15 MB
1080p30 HEVC silent 4.367 (5.1–5.6) 21 MB
1080p30 HEVC audio, muted 13.7 (14.8–17.7) 47 MB
4K60 HEVC silent 7.033 (7.8–8.9) 26 MB
1080p30 H.264 silent 4.217 (4.7–5.5) 21 MB
Paused 1080p30 HEVC 0.017 19 MB

Muted audio still builds AudioToolbox (AQMEIO_HAL::IOProc). Paused keeps figThreadMain and ~82 MB IOSurface virtual. Idle sample caught one __NSFireTimer from the 20 s battery timer; idle top stayed 0.0%.

Ranked next work is in docs/perf-findings.md: H (disable audio tracks when muted), then J (cap/transcode to 1080p30, not 5K-native), then B (cold pause), then A/E/F (wake-ups). P2 is not in this PR.

Still need the operator / Xcode

sudo powermetrics --samplers tasks --show-process-energy \
  --show-process-wait-times -i 1000 -n 30 --process-name Lively

xctrace record --template 'Time Profiler' --time-limit 30s \
  --output /tmp/lively-time.trace --attach <pid>

xctrace needs full Xcode and powermetrics needs sudo, so this pass uses
top, footprint, sample, heap, and vmmap. Muted audio is the largest
playing cost; paused playback keeps CoreMedia and IOSurface. Idle CPU
is already 0.0% with the 20 s battery timer still firing once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant