Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf: desktop and server start without shell and fork waits, and thread views stay mounted #18219

Closedmaria-rckswants to merge 250+ commits intot3/app-startup-performance-audit fromt3/perf-wave2opened View on GitHub

Showing 229 changed files with 51 additions and 53 deletions (loading 225).

x
0 of 229 viewed, 229 left
40 additions and 50 deletionsapps/desktop/src/app/DesktopApp.tsModified
View file
@@ -24,7 +24,6 @@
import * as DesktopLifecycle from "./DesktopLifecycle.ts";
import * as DesktopLinuxUrlHandler from "./DesktopLinuxUrlHandler.ts";
import * as DesktopObservability from "./DesktopObservability.ts";
-import * as DesktopPreReadyPlatform from "./DesktopPreReadyPlatform.ts";
import * as DesktopShutdown from "./DesktopShutdown.ts";
import * as DesktopServerExposure from "../backend/DesktopServerExposure.ts";
import * as DesktopAppSettings from "../settings/DesktopAppSettings.ts";
@@ -35,7 +34,6 @@
import * as DesktopSnapShot from "../snapShot/DesktopSnapShot.ts";
import * as DesktopWslBackend from "../wsl/DesktopWslBackend.ts";
import * as DesktopRendererHistory from "../telemetry/DesktopRendererHistory.ts";
-import * as HostProcess from "@t3tools/shared/HostProcess";
​
const DEFAULT_DESKTOP_BACKEND_PORT = 3773;
const MAX_TCP_PORT = 65_535;
@@ -166,6 +164,13 @@
const desktopWindow = yield* DesktopWindow.DesktopWindow;
const snapShot = yield* DesktopSnapShot.DesktopSnapShot;
const appActivation = yield* DesktopAppActivation.DesktopAppActivation;
+ const shellEnvironment = yield* DesktopShellEnvironment.DesktopShellEnvironment;
+ const shutdown = yield* DesktopShutdown.DesktopShutdown;
+ // A quit during shell startup must prevent subsequent bootstrap work.
+ const awaitShellEnvironment = Effect.raceFirst(
+ shellEnvironment.installIntoProcess.pipe(Effect.as(true)),
+ shutdown.awaitRequest.pipe(Effect.as(false)),
+ );
yield* logBootstrapInfo("bootstrap start");