mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* 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.
3.2 KiB
3.2 KiB
Performance benchmarks
Hex is benchmarked with strobe as a native
app. strobe builds two variants (for example origin/dev and your checkout),
launches each in a fresh private home, and compares them in alternating runs.
strobe bench perf/idle.bench.ts --base origin/dev --head .
strobe bench perf/launch.bench.ts --base origin/dev --head .
strobe bench perf/idle.bench.ts --check # one short, untimed pass
Run timed benches on a quiet machine. Close other apps and keep the session unlocked.
What runs
strobe.jsonbuildshexwith--profile strobe --features strobeinto{cache}/cargo-target, a target folder strobe shares between variants. Today the build output is the Windows executable.- The
strobeprofile is release's code with line tables kept inhex.pdb, so CPU profiles name Hex's functions. It is never shipped. - The
strobefeature is the hook for the UI toolkit's benchmark bridge. It changes nothing in Hex yet. - On a machine whose default Rust toolchain is not MSVC, set
RUSTUP_TOOLCHAIN=stable-x86_64-pc-windows-msvcbefore you run strobe. Windows builds also need the Vulkan SDK (docs/windows.md).
Isolation
The hex app profile in strobe.json keeps a launched copy away from your
own Hex:
HEX_APPLICATION_SUPPORT_DIR={home}/hex-data: settings, history, logs, models, locks, andlocal-api.jsonlive in the private home.- A data root other than the default claims its own Windows single-instance
event, so the copy never signals or yields to your running Hex, and on
Linux never hands the launch to your systemd unit. Inside a redirected
home the default (
AppData/Roaming/hex,.local/share/hex) follows the redirection, so name another folder, ashex-datadoes. HEX_DISABLE_UPDATES=1: no update checks and no network.USERPROFILE(Windows) andHOMElocate~/.config/hex, so yourhex.config.tsstays out of the copy.HF_HUB_CACHE={home}/.cache/huggingface/hub: the copy never finds models in your Hugging Face cache (on Windows that scan otherwise reads your real profile).- The seeded
settings.jsonkeeps the listener off (enable_on_launch: false): no keyboard hook, no microphone, and no model load. History is kept forever, so a seededhistory.jsonnever expires mid-run. The seededonboarding-completemarker skips first-run setup. The twoscrawl-*migrations skip importing Scrawl's settings from your home. guardstops a run if your ownsettings.jsonorlocal-api.jsonchanges, or your Hex exits.
The copy loads no model. A future case that dictates must seed one into
hex-data/models.
Cases
| File | Case | Primary | Measures |
|---|---|---|---|
perf/idle.bench.ts |
window-open |
cpu.work |
8 s at rest with the window on General |
perf/idle.bench.ts |
window-closed |
cpu.work |
8 s at rest, tray only (app --hidden) |
perf/launch.bench.ts |
cold-launch |
launch.ready |
Process start to the first painted window |
Secondary metrics are thread wakeups (cpu.wakes), GPU use, and private
memory. strobe query <rec> threads names the threads; Hex names every
long-lived thread, and the window's thread is hex-ui on Windows.