Files
hex/perf/launch.bench.ts
Luke Parker 3a5958b90f macOS: the window and HUD draw with Rune's Metal backend, not wgpu (#1347)
Rune 90355ba: the native Metal backend offers IMMEDIATES, which the
window's and HUD's compositors ask for (their Painter), so they no
longer fall back to wgpu, and the window keeps the prewarmed device.
process.log names the backend each window and HUD device draws with
(rune::describe_gpu). launch.bench.ts gains first-frame;
interaction.bench.ts measures gpu.process.3d and drives macOS through
accessibility and the wheel.
2026-11-04 19:52:55 -06:00

53 lines
1.8 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" }
// The window's compositor logs its first frame and the backend it drew with.
const drawn = { match: "window draws" }
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 window's first frame drawn, from Hex's own log: needs no screen
// capture (macOS refuses `painted` without Screen Recording). It covers
// the GPU device and pipelines the window draws with.
"first-frame": {
targets: ["window"],
primary: "launch.ready",
metrics: ["launch.api", "cpu.work", "memory.app.private"],
launch: {
until: { milestone: "drawn" },
milestones: { drawn, 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 },
},
},
},
})