hex/perf/launch.bench.ts
Luke Parker 7a1d4c3872
perf: say that strobe keeps GPU shader caches warm, so cold-launch is a returning user's launch (#1281)
strobe 0.6.0 keeps each variant's compiled shaders across its launches by default (gpuCache warm). docs/perf.md says what that means for the cases and when a target would need gpuCache cold.
2026-11-04 09:16:30 -06:00

38 lines
1.2 KiB
TypeScript

// Launches (docs/perf.md): process start, fonts, GPU device and pipelines,
// and the first frames.
import { bench, native } from "@hona/strobe"
const api = { match: "local API started" }
export default bench({
targets: {
// Needs an unlocked session: it ends on the window's first painted frame.
// A returning user's launch: the GPU shader caches stay warm (strobe's
// default), as after any earlier launch (docs/perf.md).
window: native("hex"),
// A login launch with no window. Runs on a locked session too.
tray: native("hex", { args: ["--hidden"], window: false }),
},
cases: {
"cold-launch": {
targets: ["window"],
primary: "launch.ready",
metrics: ["launch.settled", "launch.api", "cpu.work", "memory.app.private"],
launch: {
until: { window: "painted" },
// The local API starts on its own thread while the window opens.
milestones: { api },
},
},
// To the local API answering: the runtime, tray, and overlays are up.
"hidden-launch": {
targets: ["tray"],
primary: "launch.ready",
metrics: ["cpu.work", "memory.app.private"],
launch: {
until: { milestone: "api" },
milestones: { api },
},
},
},
})