Skip to content

Performance track: CPU/RAM/GPU sidecar, perf overlay, and bug_report summary #335

Closed

Description

@TMHSDigital

Summary

Record a performance track alongside the video: CPU, memory, GPU and (where available) frame timing for the target app, sampled once or twice a second into a sidecar. Add a perf_overlay step that draws a small live graph on the video, and a bug-report summary ("CPU pinned at 98% from 0:12 to 0:31, RSS +1.2 GB").

Where

  • src/tools/startRecording.ts: window targets (window:exe=<app.exe>, window:hwnd=<n>) already resolve to a specific window (src/utils/resolveTarget.ts), from which the owning process to sample can be found.
  • src/utils/bugReport.ts: environment section has static machine info only, no runtime behaviour.
  • Nothing in src/ samples process counters today.

Details

"It freezes when I click Export" is the most common bug that a video alone can't explain. A synced resource track shows whether it was CPU-bound, leaking memory or waiting on disk, and the overlay makes that obvious in a shared clip.

Sidecar <recording>.perf.jsonl:

{ "t": 12.0, "pid": 4312, "cpu": 97.5, "rssMB": 1840, "gpu": 12.0 }

Suggested fix

  1. start_recording { perf: true | { intervalMs } }: sample the target process tree (and the whole system for full/monitor:) via a single long-lived PowerShell/typeperf helper, not one spawn per sample.
  2. Write the sidecar on the video clock like the event log.
  3. perf_overlay tool and pipeline op: render a sparkline (CPU/RAM) in a corner using the existing drawing helpers (src/utils/callout.ts / anim.ts).
  4. bug_report: add a "Resource usage" section with peaks and spans above thresholds.
  5. index_recording: index spikes as text ("cpu spike 97%") so search_recording can find them.

Acceptance criteria

  • One sampler process per recording, stopped and cleaned up on every stop path
  • Sidecar aligned to the video clock
  • Overlay renders at any output size and survives trim/speed in pipeline
  • bug_report summarises peaks
  • Helper is covered by the orphan-reaping logic

Getting started

  • Relevant files: src/tools/startRecording.ts, src/utils/resolveTarget.ts, src/utils/bugReport.ts, src/utils/pipeline.ts
  • Tests: npm test

Related: #272


Filed by repo-audit/feature-ideas at 19569f7. Severity: medium. Effort: L. audit-key: enhancement|src/tools/startRecording.ts|perf

Activity

  1. added
    enhancement
    effort: large
    on Nov 15, 2026
  2. TMHSDigital commented on Nov 16, 2026

    @TMHSDigital
    OwnerAuthor

    Partly done in 38a38ea: start_recording perf: true writes .perf.jsonl on the video clock (machine CPU and memory, plus the window target's process CPU and working set), the session gets a peak summary, bug_report has a Resource usage section for the clip, and delete_recording removes the sidecar. Verified with unit tests and a live window recording (no PowerShell helper left after stop). Still open: the perf_overlay graph (and a pipeline op for it), and indexing spikes for search_recording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: largeenhancementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions