Skip to content

perf: P0 hygiene and measurement baseline - #9

Open
harshabala wants to merge 3 commits into
masterfrom
perf/p0-hygiene-baseline
Open

harshabala wants to merge 3 commits into
masterfrom
perf/p0-hygiene-baseline

Conversation

@harshabala

@harshabala harshabala commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

P0 only: hygiene, measurement harness, os_signpost intervals, and a baseline. Daily playback is unchanged unless LIVELY_PERF_MODE is set.

Setting HOME does not redirect FileManager.userDomainMask on current macOS. The harness now also sets LIVELY_APPLICATION_SUPPORT and LIVELY_CONFIG_FILE, and uses a throwaway com.lively.app.perf UserDefaults suite. Without those overrides the playing/paused modes write the fixture into the live config.

Dependabot actions/checkout 4 → 7 was merged separately as #8.

BEFORE (pre-P0)

docs/PERFORMANCE.md stated its targets were never measured on hardware. No footprint / top / Energy numbers existed.

AFTER (isolated 30 s, this branch)

Host: Apple M1, macOS 27.0.1. Release .app from ./package.sh (CLT). Isolated Application Support, popover closed, 30 s top after settle. Fixture 1080p30-hevc-silent.mp4. User config_v2.json checksum unchanged (2558921003 1531).

Metric Idle Playing 1080p30 HEVC Paused Budget
footprint resident 14 MB (peak 15) 21 MB (peak 22) 20 MB (peak 21) 20 / 60 / 25 MB
top CPU % 0.0 (all 6 samples) 4.783 avg; last five 5.5–6.1 0.133 avg 0.0 / 1.5 / 0.0
Threads 9 → 3 25–27 8–10 —
Idle wake-ups / s not sampled not sampled not sampled <= 1
Energy Impact not sampled not sampled not sampled 0 / 3 / 0
Executable 4,366,496 bytes (4.16 MiB) same same track

sample(1): idle is CFRunLoop waiting; playing is AVPlayer decode; paused still has figThreadMain waiting (hypothesis B hint).

Playing CPU is above the 1.5% budget once decode is up (~5.7% of one core). RAM is inside budget. Paused stays ~6 MB above idle.

Discard same-day tables that used HOME only. Those runs mixed the live wallpaper into “idle.”

Not measured (need sudo / full Xcode)

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

xctrace record --template 'Energy Log' --time-limit 30s \
  --output /tmp/lively-energy.trace \
  --launch -- /private/tmp/LivelyOutput/Lively.app/Contents/MacOS/Lively

./test.sh: 97 tests passed (including AppSupportPathsTests).

P1 plan (not in this PR)

Read-only Instruments pass. Rank hypotheses A–N in docs/PERFORMANCE_MASTER_PLAN.md with evidence in docs/perf-findings.md. Do not skip. Do not start P2 until that ranking exists.

  1. Time Profiler on idle, playing, paused (popover closed). Attach to com.lively.app / Performance signposts.
  2. Allocations: confirm or refute B (player left resident while paused) and C (popover tree at launch).
  3. System Trace / powermetrics idle wake-ups (hypothesis A, 20 s battery timer).
  4. Energy Log playing vs paused.
  5. Re-rank A–N by measured impact. P2 is wake-ups only after that.

This machine has Command Line Tools only; Energy Log / Time Profiler need Xcode.app.

harsha balakrishnan added 3 commits October 13, 2026 17:05
OSSignposter intervals wrap launch, synchronize, player build, pause
and resume. scripts/perf/measure.sh packages a release app, launches it
with a throwaway HOME, and records top plus footprint JSON. Playing and
paused modes assign a generated fixture through existing ConfigStore
assign. No config schema or spaceKey change. Finder duplicate copies
are gitignored.
Apple M1, macOS 27.0.1, 20 s samples: idle 13 MB / 0.0% CPU, playing
1080p30 HEVC 18 MB / ~3% CPU, paused 17 MB / 0.0% CPU. Wake-ups and
Energy Impact are blank because powermetrics needs sudo. Playing CPU
is already above the 1.5% budget.
HOME does not redirect FileManager.userDomainMask on current macOS, so
the harness wrote fixtures into the live config. Route config, run
marker, and library I/O through LIVELY_APPLICATION_SUPPORT and
LIVELY_CONFIG_FILE, use a throwaway UserDefaults suite in perf mode,
and record the isolated 30s baseline.
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