Skip to content

Latest commit

 

History

History
72 lines (60 loc) · 3.96 KB

PERFORMANCE.md

File metadata and controls

72 lines (60 loc) · 3.96 KB

Profiling

Run measurements sequentially with other tests, using invented demo data and ignored build*/ output directories. Keep the window visible and use the same backend, renderer, display, motion settings and workload for comparisons.

Installed application

mkdir -p build-performance
flatpak run --user --command=python3 \
  --filesystem="$PWD:ro" --filesystem="$PWD/build-performance" \
  --env=PYTHONPATH=/app/share/skyloom com.nedrichards.Skyloom \
  "$PWD/scripts/performance-pass.py" --posts 250 \
  --output "$PWD/build-performance/candidate.json"
python3 scripts/compare-performance.py build-performance/baseline.json build-performance/candidate.json

Collect a baseline before editing and rebuild/install before the candidate. Use --help for startup, scrolling, interactions, idle, reduced-motion and plain-list control workloads. Run --profile separately: cProfile overhead invalidates frame comparisons.

For a local before/after comparison, alternate baseline and candidate runs on the same display. Keep the per-run setup time, maximum paint span during feed creation, scrolling p95, presentation samples and distance travelled. For feed retention, visit several distinct full feeds and record mounted views, bound rows and process RSS after each switch. Measure a revisit as well, since rebuilding an evicted view can take longer than switching to a mounted one.

Use --mixed-media --scroll-only for alternating portrait, square and landscape photos/video thumbnails. These are invented records backed by local fixture pixels; no stream plays and no external thumbnail request is made. Reports record this workload separately, and the comparator rejects mixing it with the ordinary feed. This isolates row layout/rendering and does not simulate remote download latency, distinct-photo decoding or physical momentum.

For sustained row-tracker diagnostics, add --scroll-seconds 12 --scroll-speed 6000 --trace-layout. The trace counts factory binds/unbinds, media measurements, allocations and viewport bounds calls, and records counts on slow paint spans. Record generated posts, active row count and actual travel together. The active pager window can be smaller than the generated history. Trace instrumentation adds overhead. Use a separate run without --trace-layout for frame comparisons. The comparator also checks speed, duration and trace mode. A short, warm scroll is insufficient to exercise mixed-height tracker oscillation.

The viewport trace counts the existing per-widget checks for mapped media. It also measures rows with two or more mapped media widgets as a possible shortcut. The shortcut would skip widget bounds only for a row entirely outside the existing retention band. Subtract media_candidate_skipped_bounds from media_candidate_row_bounds to get the change in calls. Any media_candidate_mismatches means the shortcut would have released a widget the existing check would retain. The trace leaves media loading and eviction to the existing widget checks.

Focused probes in scripts/ cover post-cell binding, label/row measurement, media residency and thread prefetch. Their --help describes inputs. Construction and retain-all modes simulate alternative ownership with current code; they are not old-binary comparisons or compositor benchmarks.

Interpreting results

Keep tail latency, cold construction, work counts and travelled distance alongside frame cadence. Missing or throttled samples cannot establish improvement. Static pages need not present continuously; a gap between presentations is not evidence of a main-thread stall. Paint spans do not measure GPU completion. CPU/context switches do not measure battery energy, and estimated decoded pixels are not RSS.

Current local comparisons are recorded in DELIVERY_REPORT.md. Dense cold views and long conversations remain priorities in ROADMAP.md. Validate physical momentum under the normal renderer and repeat comparisons on additional hardware and media workloads.