aboutsummaryrefslogtreecommitdiffstats
path: root/Cargo.lock
diff options
context:
space:
mode:
authorMichelle Tilley <michelle@michelletilley.net>2026-02-26 19:08:08 -0800
committerGitHub <noreply@github.com>2026-02-26 19:08:08 -0800
commit00f9d1cdee372c48b48b1d237dcdb75f65d7f46d (patch)
treef52eebd950efc6a0e21060a73ac3d2053f0935de /Cargo.lock
parentchore(deps): bump actions/attest-build-provenance from 2 to 3 (#2897) (diff)
downloadatuin-00f9d1cdee372c48b48b1d237dcdb75f65d7f46d.zip
fix: Dramatically decrease daemon memory usage (#3211)
Reduces memory usage of the atuin-daemon search index by ~80% through string interning, compact UUID storage, and eliminating redundant data. ## Changes * **Eliminate Vec\<Invocation\>**: Replaced the per-command `Vec<Invocation>` with just `most_recent_id: [u8; 16]` and `most_recent_timestamp: i64`. We only ever needed the most recent history ID for search results - the full invocation history was never used. * **UUID byte storage**: Store UUIDs as `[u8; 16]` instead of 36-byte strings, saving 40 bytes per UUID. * **String interning with lasso**: Use `ThreadedRodeo` to deduplicate `cwd` and `hostname` strings in the filter sets. These values are highly repetitive (most commands run from a small set of directories on the same host), so interning has an outsized effect. * **DashSet → HashSet**: Since `CommandData` lives inside a `DashMap` (already synchronized), the inner sets don't need their own locks. Switched to `HashSet<Spur>` for directories/hosts and `HashSet<[u8; 16]>` for sessions. * **Arc\<str\> for commands**: Changed the `commands` DashMap key and `frecency_map` keys from `String` to `Arc<str>`, enabling zero-copy sharing between the two maps. * **Remove dead code**: Removed `CommandData.command` field that was duplicating the DashMap key. ## Results With 60k history entries, observed memory usage dropped from ~200MB to ~40MB.
Diffstat (limited to '')
-rw-r--r--Cargo.lock31
1 files changed, 30 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c7ee0947..248da058 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -375,9 +375,10 @@ dependencies = [
"atuin-common",
"atuin-dotfiles",
"atuin-history",
- "dashmap",
+ "dashmap 5.5.3",
"eyre",
"hyper-util",
+ "lasso",
"listenfd",
"nucleo",
"prost",
@@ -1266,6 +1267,20 @@ dependencies = [
]
[[package]]
+name = "dashmap"
+version = "6.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
+dependencies = [
+ "cfg-if",
+ "crossbeam-utils",
+ "hashbrown 0.14.5",
+ "lock_api",
+ "once_cell",
+ "parking_lot_core",
+]
+
+[[package]]
name = "deltae"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1923,6 +1938,10 @@ name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
+dependencies = [
+ "ahash",
+ "allocator-api2",
+]
[[package]]
name = "hashbrown"
@@ -2470,6 +2489,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f"
[[package]]
+name = "lasso"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e14eda50a3494b3bf7b9ce51c52434a761e383d7238ce1dd5dcec2fbc13e9fb"
+dependencies = [
+ "dashmap 6.1.0",
+ "hashbrown 0.14.5",
+]
+
+[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"