diff --git a/bun.lock b/bun.lock index 7eaa555b941..ba71a25146f 100644 --- a/bun.lock +++ b/bun.lock @@ -1055,7 +1055,7 @@ "@effect/platform-node-shared": "4.1.0", "@effect/sql-sqlite-bun": "4.1.0", "@effect/sql-sqlite-node": "4.1.0", - "@hona/strobe": "0.3.0", + "@hona/strobe": "0.6.0", "@kobalte/core": "0.13.13", "@lydell/node-pty": "1.2.0-beta.12", "@npmcli/arborist": "9.4.0", @@ -1695,17 +1695,17 @@ "@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.0.11", "", { "dependencies": { "@types/node": "^20.0.0", "happy-dom": "^20.0.11" } }, "sha512-GqNqiShBT/lzkHTMC/slKBrvN0DsD4Di8ssBk4aDaVgEn+2WMzE6DXxq701ndSXj7/0cJ8mNT71pM7Bnrr6JRw=="], - "@hona/strobe": ["@hona/strobe@0.3.0", "", { "optionalDependencies": { "@hona/strobe-darwin-arm64": "0.3.0", "@hona/strobe-darwin-x64": "0.3.0", "@hona/strobe-linux-arm64": "0.3.0", "@hona/strobe-linux-x64": "0.3.0", "@hona/strobe-win32-x64": "0.3.0" }, "bin": { "strobe": "bin/strobe.js" } }, "sha512-cTtyAlXKevzGbUY/fFf02PufqaBQ0Fdree0A3YdGSa8oIruKWv04hQ3Es2PV5ULQgeMAuXCmXKWexhH2QYYRLA=="], + "@hona/strobe": ["@hona/strobe@0.6.0", "", { "optionalDependencies": { "@hona/strobe-darwin-arm64": "0.6.0", "@hona/strobe-darwin-x64": "0.6.0", "@hona/strobe-linux-arm64": "0.6.0", "@hona/strobe-linux-x64": "0.6.0", "@hona/strobe-win32-x64": "0.6.0" }, "bin": { "strobe": "bin/strobe.js" } }, "sha512-KkGO9k3tLwZq0X4epJgrAFNQyO515969aTfkC8CBjMWchRuofW66LbucYP+up3UP6Fb5kg7VUuP1yb8Dcdls0Q=="], - "@hona/strobe-darwin-arm64": ["@hona/strobe-darwin-arm64@0.3.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-yiMhlr62ob6YLMlfIEvlDpHeDDYB/SyIYA9zeZTGQNM83ABexChjRXYJ2rEvHdWol+LL/Ood8f4stdNnK6d1DA=="], + "@hona/strobe-darwin-arm64": ["@hona/strobe-darwin-arm64@0.6.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-7d1IFyjXYl1GiGyWPT1Yqvc9XkZJy7a5/E4JfvinupenszJTXkFZrQCz1JuuAyHqhKc5zchmlvCVll2bGCIu2A=="], - "@hona/strobe-darwin-x64": ["@hona/strobe-darwin-x64@0.3.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-hVC8oC3VyP4NPdc/caT2+9HxO68yQAir1jdmVdQgVY5t8f1jqO5cU+5f1aGviPc5IzfOq7PP8p3I3dt++jxEpw=="], + "@hona/strobe-darwin-x64": ["@hona/strobe-darwin-x64@0.6.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-o5HAqoSN/DLIGJb0VSIzBTP4iyys9gDPkQotVqhgxgvG687P6w7uV+c2ZBXT9O1DQxraTbIc61PI1e54fhtskA=="], - "@hona/strobe-linux-arm64": ["@hona/strobe-linux-arm64@0.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-EnphpmsfwNIq+bnyUYzMzxprv8Uhm8BuO8mrrvkgrjndL9Zz3ciE8nF93DKoeRdomc7rpmsCzXYm4y+JlrqUWg=="], + "@hona/strobe-linux-arm64": ["@hona/strobe-linux-arm64@0.6.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-wvmWlB5vYJ0DTCpbboTMB6xW4I5SQkYz2P92lAoqlHZq1CV+smMLCOwjs8Ml1Cz9IsLbUNQ6zR/ggWuE7GRhOQ=="], - "@hona/strobe-linux-x64": ["@hona/strobe-linux-x64@0.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-J3Ac2+moTFk9H3AX/RIIS6bgi53eBgIn7WvT7YQmDN98DS9O8/eSpWY51nBsq3aJ8a35oqS/9vWBUBJt5aGiEw=="], + "@hona/strobe-linux-x64": ["@hona/strobe-linux-x64@0.6.0", "", { "os": "linux", "cpu": "x64" }, "sha512-0C7lK/bakN4EGKCCbKOMmBGqfB/iz3cDQJC8RNRSpgVXTbtmitRywTs1UK11WbMhB0AkaSVqBfA2FYFXILePSg=="], - "@hona/strobe-win32-x64": ["@hona/strobe-win32-x64@0.3.0", "", { "os": "win32", "cpu": "x64" }, "sha512-IIgLYxaYRsPkvVQ6Ji7d7tLG9BcewzL1tAj+RPqDyJpdT/e6QoGH7IEVQpMKBLv5T72ZeaezXV9+b2TX/9Uq/A=="], + "@hona/strobe-win32-x64": ["@hona/strobe-win32-x64@0.6.0", "", { "os": "win32", "cpu": "x64" }, "sha512-XSAeRz0Z+g/8Z3cU/c8I80yiH5Z96xXvw4f1e2kBUm9ukrFFDkm1mheP5KLsx7Nq/aNtsqTXLLiw1mmwHuioVA=="], "@hono/node-server": ["@hono/node-server@2.1.5", "", { "peerDependencies": { "hono": "^4 || ^5.0.0-0" } }, "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q=="], diff --git a/package.json b/package.json index 7c2bd5f60d7..eafe87521fb 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@effect/sql-sqlite-node": "4.1.0", "@npmcli/arborist": "9.4.0", "@types/bun": "1.4.3", - "@hona/strobe": "0.3.0", + "@hona/strobe": "0.6.0", "@types/cross-spawn": "6.0.6", "@octokit/rest": "22.0.0", "@opentui/core": "0.8.1", diff --git a/packages/desktop/README.md b/packages/desktop/README.md index d06268fc27a..444e7650d4d 100644 --- a/packages/desktop/README.md +++ b/packages/desktop/README.md @@ -58,14 +58,18 @@ and `SENTRY_*` environment removed), so it never touches the developer's app, pr | launch to Home | Profile kept from earlier launches; the service already runs, from the bundled CLI. | Home | | launch to a restored tab | Profile kept; the first launch's onboarding draft is restored. | The composer | | launch to Home, service stopped | Profile kept; the desktop spawns its service. | Home | -| first launch | No profile: right after an install, onboarding opens a draft. | The composer | +| first launch | No profile or GPU shader caches: right after an install, onboarding opens a draft. | The composer | | dev start to Home | `bun dev:desktop` with Vite's caches and `out` deleted. | Home | ```bash -# Two packaged builds (pack each with OPENCODE_CHANNEL=beta or prod), or two installed channels. +# A returning user's launches of two packaged builds (pack each with OPENCODE_CHANNEL=beta or prod), or two installed +# channels. strobe bench perf/startup.bench.ts --target desktop --base exe:/OpenCode.exe --head exe:/OpenCode.exe strobe bench perf/startup.bench.ts --target desktop --base app:opencode --head app:opencode-beta +# The first launch after an install. +strobe bench perf/startup.bench.ts --target install --base app:opencode --head app:opencode-beta + # The dev loop's cold start, dev against this checkout. strobe bench perf/startup.bench.ts --target dev --base origin/dev --head . ``` @@ -78,7 +82,9 @@ marks from its log (`entry`, `electron`, `window`, `served`, `bundle`, `logging` `visible`, `service.starting`, `service.ready`; `src/main/lifecycle/marks.ts`), or each step of the dev command's output. `launch.painted` and `launch.settled` are when the window's pixels first and last changed, `cpu.work` is the CPU every process used until ready, and `launch.node.*` is Node's bootstrap timing in builds that accept `--inspect`. The -first launch of each build is discarded, because a new binary pays the antivirus scan. `--why always` adds a profiled +first launch of each build is discarded, because a new binary pays the antivirus scan. The packaged +returning-user cases keep the GPU shader caches their build compiled in earlier launches, as a person's machine has +them; `first launch` starts each launch without them. `--why always` adds a profiled launch per build: the main process and the renderer, both from their first statement. A packaged beta or prod build registers itself as the `opencode://` handler when it starts, even from the bench; the diff --git a/packages/desktop/perf/startup.bench.ts b/packages/desktop/perf/startup.bench.ts index 5f9e277a2fe..943c79634d6 100644 --- a/packages/desktop/perf/startup.bench.ts +++ b/packages/desktop/perf/startup.bench.ts @@ -54,7 +54,12 @@ export default bench({ targets: { // The installed app by its strobe.json profile. Compare two packaged builds with // `--base exe: --head exe:`, or channels with `--base app:opencode-beta`. + // Launches keep the GPU shader caches earlier launches of the same build compiled (strobe's `gpuCache: "warm"`), + // as a returning user's machine has them. desktop: app("opencode"), + // Right after an install the driver and Chromium have compiled none of the app's shaders: every launch starts + // with empty GPU shader caches. + install: app("opencode", { gpuCache: "cold" }), // A contributor's `bun dev:desktop` in each variant's checkout, isolated under the launch's home. dev: command("bun dev:desktop", { unset: ["OPENCODE_*", "OTEL_*", "SENTRY_*"], @@ -101,10 +106,10 @@ export default bench({ targets: ["desktop"], launch: { until: home, milestones: packaged, profile: "warm", before: skipOnboarding }, }, - // Right after an install: no profile, and onboarding opens a draft session. + // Right after an install: no profile, no GPU shader caches, and onboarding opens a draft session. "first launch": { primary: "launch.ready", - targets: ["desktop"], + targets: ["install"], launch: { until: composer, milestones: packaged }, }, // `bun dev:desktop` with Vite's caches and the built output deleted.