hex/perf/idle.bench.ts
Luke Parker e5ccf0c3ea
Let strobe launch an isolated Hex (#1180)
* Let strobe launch an isolated Hex

Scope the Windows instance event to a custom data root, read ~/.config/hex from USERPROFILE on Windows, add HEX_DISABLE_UPDATES, name the UI and remaining long-lived threads, and add the strobe profile and feature, strobe.json, perf benches, and docs/perf.md.

* strobe.json: keep the copy out of the Hugging Face cache

* strobe.json: keep seeded history

* Windows instance event: keep the default event for the default root

Naming the default data root in HEX_APPLICATION_SUPPORT_DIR must not let two apps share it.
2026-11-04 06:05:58 +10:00

37 lines
1 KiB
TypeScript

// Hex at rest, measured from outside (docs/perf.md): no input, no listener.
// Each run waits 8 s; strobe counts the process's CPU, thread wakeups, GPU
// and memory over it.
import { bench, native } from "@hona/strobe"
const quiet = ["cpu.wakes", "cpu.app.total", "gpu.process.3d", "memory.app.private"]
export default bench({
targets: {
// The Settings window open on General.
window: native("hex", { bridge: false }),
// A login launch: the tray only, no window.
tray: native("hex", { args: ["--hidden"], bridge: false }),
},
// Startup work (fonts, GPU, first frames) finishes before any run.
async setup({ page }) {
await page.wait(5_000)
},
cases: {
"window-open": {
targets: ["window"],
primary: "cpu.work",
metrics: quiet,
async run({ page }) {
await page.wait(8_000)
},
},
"window-closed": {
targets: ["tray"],
primary: "cpu.work",
metrics: quiet,
async run({ page }) {
await page.wait(8_000)
},
},
},
})