| ... | @@ -379,10 +379,18 @@ const installWindowsEnvironment = Effect.fn("desktop.shellEnvironment.installWin | ... | @@ -379,10 +379,18 @@ const installWindowsEnvironment = Effect.fn("desktop.shellEnvironment.installWin |
| 379 | function* ( | 379 | function* ( |
| 380 | config: ShellEnvironmentConfig, | 380 | config: ShellEnvironmentConfig, |
| 381 | ): Effect.fn.Return<void, never, ChildProcessSpawner.ChildProcessSpawner> { | 381 | ): Effect.fn.Return<void, never, ChildProcessSpawner.ChildProcessSpawner> { |
| 382 | const noProfile = yield* readWindowsEnvironment(["PATH"], { loadProfile: false }); | 382 | // Concurrent, not sequential: these two probes are independent (only their |
| 383 | const profile = yield* readWindowsEnvironment(WINDOWS_PROFILE_ENV_NAMES, { | 383 | // results are combined below) and each spawns its own PowerShell. Run in |
| 384 | loadProfile: true, | 384 | // series they sit at offset 0 of desktop.startup, before anything else, and |
| 385 | }); | 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 | ); |
| 386 | const mergedPath = mergePaths("win32", [ | 394 | const mergedPath = mergePaths("win32", [ |
| 387 | trimNonEmpty(profile.PATH), | 395 | trimNonEmpty(profile.PATH), |
| 388 | trimNonEmpty(knownWindowsCliDirs(config.env).join(";")), | 396 | trimNonEmpty(knownWindowsCliDirs(config.env).join(";")), |