From c7ab751e39532ed31d3a00b0457c31907d6d957c Mon Sep 17 00:00:00 2001 From: Bossiara13 <236771060+DmitryBykov-ISPO@users.noreply.github.com> Date: Fri, 15 May 2026 17:13:49 +0300 Subject: [PATCH] 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. --- crates/jarvis-app/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/jarvis-app/src/main.rs b/crates/jarvis-app/src/main.rs index 3e888ed..fb82dc7 100644 --- a/crates/jarvis-app/src/main.rs +++ b/crates/jarvis-app/src/main.rs @@ -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);