Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): streamed browser tabs show about 50 fps instead of 25 #19462

Closedluke2x(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/19462/headopened View on GitHub

Showing 3 changed files with 199 additions and 9 deletions.

x
0 of 3 viewed, 3 left
14 additions and 0 deletionsapps/server/src/preview/ServerBrowser.test.tsModified
View file
@@ -492,6 +492,20 @@
).pipe(Effect.provide(layer)),
​
+it.live("configures the viewer screencast to allow six frames in flight", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const { browser, tabId } = yield* ready;
+ yield* browser.attachViewer(viewerInput(tabId, false));
+ const session = contexts[0]!.sessions.at(-1)!;
+ expect(session.send).toHaveBeenCalledWith(
+ "Page.startScreencast",
+ expect.objectContaining({ format: "jpeg", quality: 70, maxFramesInFlight: 6 }),
Thread on line 503

P1 Badge Verify the frame window through observable behavior

The fake makeSession().send blindly resolves every command and never emits a Page.screencastFrame, so this test only mirrors the new object literal. It will remain green if the pinned browser ignores or rejects maxFramesInFlight, or if a later browser bump changes its semantics, even though the user-visible throughput does not improve; replace it with a focused browser-level test that counts delivered frames across acknowledgements.

AGENTS.md reference: AGENTS.md:L99-L99

Useful? React with 👍 / 👎.

Note

GPT-6 Luna is responding on behalf of Luke.

I added a browser-level regression test using T3's pinned Chrome for Testing headless shell. On this macOS arm64 run, Browser.getVersion reported Chrome 154.0.8037.92. The test observed six screencast frames with no ACKs, confirmed the count stayed at six through 30 more page paints, then observed one additional frame after each of three ACKs. The separate ServerBrowser.test.ts check still verifies the server requests maxFramesInFlight: 6.

ServerBrowser.test.ts and ServerBrowserScreencast.test.ts pass (37 tests); the server typecheck, targeted lint, formatting, and diff checks pass. This run exercised the macOS arm64 pinned browser; other platform binaries were not run here. The test caches the browser under the worktree's .t3/screencast-test, installing it there on first run if needed.

+ );
+ }),
+ ).pipe(Effect.provide(layer)),
+);
+​
it.live("applies any client's viewport, appearance, and zoom to a headless tab", () =>
Effect.scoped(
Effect.gen(function* () {
13 additions and 9 deletionsapps/server/src/preview/ServerBrowser.tsModified
View file
@@ -84,8 +84,11 @@
​
const SERVER_HOST_CLIENT_ID = SERVER_BROWSER_AUTOMATION_CLIENT_ID;
const RENDER_SCALE = 2;