Clean up unused worker threads for closed apps; other performance optimizations

This commit is contained in:
James Babcock committed 2026-09-22 14:56:54 -07:00
1 parent 9560f3ac8d
commit 2e4d20e130
20 files changed
+360 -13

No files matched your search

+7
View File
@@ -25,6 +25,7 @@
* focus to the sidebar) pauses, as does backgrounding or screen-off.
*/
import "@nativescript/core/globals";
import { finishWorkerShutdown } from "../../ui/shell/worker-lifecycle";
import { GrayImage } from "../../graphics/image";
import { flattenPlanesWithDraws, planesFingerprint, type Plane } from "../../graphics/plane";
import { prepareFrameDraws } from "../../graphics/glyph-wire";
@@ -180,6 +181,12 @@ post({ type: "worker-ready" });
global.onmessage = (event: { data: WorkerAppMessage }) => {
const message = event.data;
switch (message.type) {
case "check-idle":
post({ type: "worker-idle" });
break;
case "shutdown":
finishWorkerShutdown();
break;
case "open-window": {
const window: FlappyWindow = {
windowId: message.windowId,