aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-server-database/src/models.rs
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 /crates/atuin-server-database/src/models.rs
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 'crates/atuin-server-database/src/models.rs')
0 files changed, 0 insertions, 0 deletions