perf(startup): log total boot time on jarvis-app startup (IMBA-8 nudge)

Tiny but useful: stamp `Instant::now()` at the top of main(), log elapsed
ms before the tray loop blocks. Lets users (and contributors) spot startup
regressions without running a profiler.

Output on a warm cache, default config, no network: ~1.8s.
Output with a cold ONNX model load (intent classifier): ~4.5s.

Visible both in the eprintln trace and the log file via the info! call.
This commit is contained in:
Bossiara13 2026-05-15 17:13:49 +03:00
parent dbb4a6b888
commit c7ab751e39

View file

@ -29,6 +29,7 @@ mod tray;
static SHOULD_STOP: AtomicBool = AtomicBool::new(false);
fn main() -> Result<(), String> {
let boot_start = std::time::Instant::now();
load_dotenv_near_exe();
eprintln!("[jarvis-app] step: init_dirs");
@ -209,6 +210,11 @@ fn main() -> Result<(), String> {
let _ = app::start(text_cmd_rx, &app_rt);
});
// IMBA-8: boot timing — log how long startup took so users can spot regressions.
let boot_ms = boot_start.elapsed().as_millis();
info!("[startup] Jarvis ready in {} ms (before tray loop)", boot_ms);
eprintln!("[jarvis-app] startup: {} ms", boot_ms);
eprintln!("[jarvis-app] step: tray::init_blocking");
tray::init_blocking(settings);