From 4efc2f396842fa0bd217e401a241f62cb8c86472 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Mon, 16 Nov 2026 23:26:34 +0100 Subject: [PATCH] record-daemon: stop reading every timeline at startup The store parsed all 309 timeline files on boot and held them in memory. Each file carries the raw API responses, so 527 MB of JSON became about 2 GB of serde values and nine seconds of startup. Nothing reads the store back: the app loads the same files from disk itself. The daemon now only writes timelines. --- record-daemon/src/main.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/record-daemon/src/main.rs b/record-daemon/src/main.rs index 77496ab..c046c94 100644 --- a/record-daemon/src/main.rs +++ b/record-daemon/src/main.rs @@ -105,7 +105,6 @@ impl Daemon { Ok::<_, String>(()) }) .await; - match result { Ok(Ok(())) => {} Ok(Err(e)) => { @@ -120,10 +119,9 @@ impl Daemon { } } - // Load existing recordings from disk - self.timeline_store.read().load_from_disk()?; - - // Initialize IPC server + // Existing timelines are not read into memory. They stay on disk as JSON, the app + // reads them from there, and nothing here serves them back over IPC. Preloading the + // store used to cost about two gigabytes of parsed JSON and nine seconds of startup. let ipc_config = IpcServerConfig { socket_path: self .settings @@ -134,7 +132,6 @@ impl Daemon { .unwrap_or_else(ipc::default_socket_path), ..Default::default() }; - let handlers = IpcHandlers::new( self.settings.clone(), self.recording_engine.clone(), @@ -146,7 +143,6 @@ impl Daemon { let mut ipc_server = IpcServer::new(ipc_config, handlers); ipc_server.start().await?; self.ipc_server = Some(ipc_server); - info!("Daemon initialized successfully"); Ok(()) }