Performance optimizations

This commit is contained in:
James Babcock committed 2026-08-20 02:46:03 -07:00
1 parent e49c699062
commit f6035ea9ec
18 files changed
+715 -158

No files matched your search

+5 -2
View File
@@ -162,6 +162,9 @@ global.onmessage = (event: { data: WorkerAppMessage }) => {
break;
}
window.focused = message.focused;
// Marks the main-thread -> worker hop, which is otherwise an
// unexplained gap inside the shell's handle-input span.
frameTimings.logFrame(message.frameId, `input received in ${message.windowId} worker`);
handleInput(window, message.event as DashboardInputEvent, message.frameId);
break;
}
@@ -666,7 +669,7 @@ function renderAndSubmit(window: TimerWindow, inputFrameId: number): void {
return;
}
const { image, draws } = frameTimings.span(frameId, "flatten", () => flattenPlanesWithDraws(planes));
const buffer = image.to8bppBuffer();
const buffer = frameTimings.span(frameId, "to8bpp", () => image.to8bppBuffer());
communicator.submitSurfaceFrame(
buffer.buffer,
window.surfaceId,
@@ -677,7 +680,7 @@ function renderAndSubmit(window: TimerWindow, inputFrameId: number): void {
fingerprint,
paintMs,
frameId,
prepareFrameDraws(draws),
frameTimings.span(frameId, "prepareFrameDraws", () => prepareFrameDraws(draws)),
);
window.lastSubmittedFingerprint = fingerprint;
} catch (error) {