Skip to content

Commit 139446a

Browse files
Merge branch 'main' into feat/web/duplicate-default-theme
2 parents 270e0ae + 8de0aa2 commit 139446a

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎apps/desktop/src/shell/DesktopShellEnvironment.ts‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,18 @@ const installWindowsEnvironment = Effect.fn("desktop.shellEnvironment.installWin
379379
function* (
380380
config: ShellEnvironmentConfig,
381381
): Effect.fn.Return<void, never, ChildProcessSpawner.ChildProcessSpawner> {
382-
const noProfile = yield* readWindowsEnvironment(["PATH"], { loadProfile: false });
383-
const profile = yield* readWindowsEnvironment(WINDOWS_PROFILE_ENV_NAMES, {
384-
loadProfile: true,
385-
});
382+
// Concurrent, not sequential: these two probes are independent (only their
383+
// results are combined below) and each spawns its own PowerShell. Run in
384+
// series they sit at offset 0 of desktop.startup, before anything else, and
385+
// launch traces measured them at 2718ms then 2066ms — the entire 4.8s
386+
// startup span, of which desktop.bootstrap is ~30ms.
387+
const [noProfile, profile] = yield* Effect.all(
388+
[
389+
readWindowsEnvironment(["PATH"], { loadProfile: false }),
390+
readWindowsEnvironment(WINDOWS_PROFILE_ENV_NAMES, { loadProfile: true }),
391+
],
392+
{ concurrency: 2 },
393+
);
386394
const mergedPath = mergePaths("win32", [
387395
trimNonEmpty(profile.PATH),
388396
trimNonEmpty(knownWindowsCliDirs(config.env).join(";")),

0 commit comments

Comments
 (0)