Skip to content

perf(cli): open the mic, camera and capture content concurrently when recording starts - #2591

Open
richiemcilroy wants to merge 3 commits into
mainfrom
perf/cli-concurrent-start
Open

richiemcilroy wants to merge 3 commits into
mainfrom
perf/cli-concurrent-start

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

cap record start set up its inputs one after another: camera, then mic, then the ScreenCaptureKit shareable content, then the actor. The mic name check also called MicrophoneFeed::list(), which opens and queries every input device for a usable config. That cost 200-680 ms before the mic was even opened.

flowchart LR
  subgraph before
    A1[camera open + lock] --> B1["MicrophoneFeed::list()<br/>(probes every device)"] --> C1[mic open + 100 ms warm-up + lock] --> D1[ShareableContent] --> E1[build actor]
  end
  subgraph after
    A2[ShareableContent] --> E2[build actor]
    B2["list_names() + mic open + warm-up + lock"] --> E2
    C2[camera open + lock] --> E2
  end
Loading
  • apps/cli/src/record.rs: the shareable content fetch, open_mic_feed and open_camera_feed run under one tokio::try_join!. The actor builders get the same locks and the same ShareableContent as before.
  • The mic name check uses MicrophoneFeed::list_names(), the same list cap targets mics prints. Opening the device still fails with the existing error if it can't be used.
  • The 100 ms mic warm-up stays. Removing it moved Instant audio start relative to video.
  • Stacked on perf(cli): skip the unused camera in macOS Instant recordings #2588 (the camera future keeps its macOS Instant skip).

Benchmark

Launch to "Recording started", real devices (built-in camera, MacBook Pro mic, system audio), median of 3, M4 Max:

Setup main This PR
Studio, mic + system audio 552 ms 292 ms (−47%)
Instant, mic + system audio 612 ms 313 ms (−49%)
Studio, camera + mic + system audio 1383 ms 841 ms (−39%)
Screen only 139 ms 141 ms
  • Every stream is present in all A/B recordings, and per-track start times match main.
  • The audio lead in Instant files is unchanged.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Prepares capture content, microphone, and camera together when recording starts.

  • Recording starts sooner when its inputs prepare together.

Reviews (2) · Last reviewed commit: "perf(cli): open the mic, camera and capt..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cap-status Ready Ready Preview Oct 20, 2026 12:16pm UTC

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy
richiemcilroy deleted the branch perf/cli-instant-skip-camera October 15, 2026 00:17
@richiemcilroy richiemcilroy reopened this Oct 15, 2026
@richiemcilroy
richiemcilroy changed the base branch from perf/cli-instant-skip-camera to main October 15, 2026 00:18

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

This branch was successfully deployed

2 active deployments
Preview – cap-web — 9473c12b Deployed Oct 20, 2026 by vercel[bot]
Preview – cap-status — 9473c12b Deployed Oct 20, 2026 by vercel[bot]
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