Repository navigation
Eng 1510 get rid of client data - #19
Conversation
ENG-1510 Get rid of set_client_data & get_client_data
libsqlite3-sys does not publish a version that contain both client_data. |
…rid-of-client-data
c50445c to
3406f9a
Compare
…-rid-of-client-data' into dorian/ENG-1510-get-rid-of-client-data
so i did the shared process-wide dict pool for all connections an i replaced the LRU with a HashMap (cap 64) on overflow we clear. That's simpler than LRU acceptable miss cost for our size and Per-connection state is only current_ids via client data |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The global cache can reuse dictionaries across unrelated databases, ignore compression levels, and grow beyond its intended limit.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Moves prepared Zstandard dictionaries from per-connection LRU caches into a shared process-wide pool.
Changes:
- Adds global encoder and decoder caches.
- Retains only current dictionary IDs per connection.
- Serializes the crate’s tests.
| File | Description |
|---|---|
.mise/tasks/sqlite-compress/test |
Runs tests serially. |
sqlite-compress/src/cache/connection.rs |
Removes prepared dictionaries from connection state. |
sqlite-compress/src/cache/lru.rs |
Deletes the per-connection LRU implementation. |
sqlite-compress/src/cache/mod.rs |
Registers the new pool module. |
sqlite-compress/src/cache/pool.rs |
Implements global prepared-dictionary storage. |
sqlite-compress/src/cache/prepared.rs |
Routes dictionary operations through the global pool. |
sqlite-compress/src/state.rs |
Removes formatting whitespace. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Entry::Vacant(e) => { | ||
| if at_cap { | ||
| let key = e.into_key(); | ||
| map.clear(); |
There was a problem hiding this comment.
This clears the whole map at cap, you sure it is what we want?
There was a problem hiding this comment.
yep the downside of this is that you need to fill it again with a lot of cache misses but i don't think we'll be doing clear that much. i mean the cost of having an LRU instead is acceptable


Fixes ENG-1510