Repository navigation
Conversation
Author
|
using fts5 for search isnt explored but probably should be |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #1994.
This is an experimental, opt-in session backend based on upstream master (
a3ef562fc). The existing JSON snapshot + JSONL journal backend remains the default. No live session data or daemon was changed to gather these results.SessionStorageinterface and explicit-rootSessionStore, with Files and SQLite implementations./transcriptexport through the store for database-only sessions.Measured workload
Frozen corpus: 3,018 sessions, 402 journals, 3.63 GB. All sessions imported without rejection and passed full persisted-value comparison. Every measured mutation was reopened and checked.
Both backends used the same unoptimized dev profile, rustc 1.98.1, warm filesystem cache, seven alternating repetitions, Intel i9-14900/Btrfs, and a shared host. These are prototype measurements, not release-build guarantees or total interactive
jcode --resumelatency.Real picker
The production
load_sessions()path ran in fresh processes, with external sessions disabled and scan limit 400. All runs returned 800 identical rows and displayed-metadata digests. Earlier runs with different selections or titles were rejected, fixed, and rerun.Median picker loading was 2.87x faster, or 2.98x with retained legacy files. The retained-file run had a slower SQLite tail observation. With seven samples on a shared host, this is not a claim of improved tail latency; p95 is the maximum of seven observations.
Full loads and writes
Sixteen size-quantile sessions, including the largest, sampled seven times. Full loads were timed on original imported state before retention preparation. Milliseconds:
The sample distribution intentionally covers size quantiles; its p95 is not a population-weighted percentile. SQLite's WAL
synchronous=FULLcommits have stronger crash durability than the current file writes, which do not fsync. Write latency is therefore not an equal-durability comparison. Activity commits, appends, and truncation medians are slower here.Import took 167.15 seconds. Whole-run peak RSS was 1,712,536 KiB, including both backends and validation, not SQLite-only memory. Initial logical storage: files 3.376 GiB, SQLite 3.296 GiB including WAL/SHM. After mutations: files 3.031 GiB, SQLite 3.260 GiB. Neither backend is compressed.
Validation
Scope and limitations
Please keep this draft while the storage boundary and remaining integrations are reviewed. SDK/harness APIs, cloud transfer, and auxiliary analytics still have direct-file consumers. Database-only sessions are not supported by every workflow yet.
There is no compression or FTS/trigram index in this PR. SQLite search uses the existing candidate/search path. Client and daemon processes must select the same backend. Native database records take precedence over legacy files; export before returning to a file-only binary.
File checkpoint retention behavior is unchanged. For steady-state writes the benchmark checkpoints the 16 file samples and gives both backends the same retained environment history before timing. Full import parity and untouched picker copies are checked before that preparation.
See
docs/SESSION_STORAGE.mdfor the interface, reproduction commands, requirement-to-check mapping, and full tradeoffs. Aggregate evidence is indocs/benchmarks/session-storage-2026-10-27.jsonanddocs/benchmarks/session-picker-2026-10-27.json.