Memories / Documentation

On this page

    Storage and synchronization baseline

    Run a disposable, synthetic benchmark from the repository root:

    cargo run -p memories-core --example storage_benchmark --release --locked -- 10,100,1000
    

    Each case creates two temporary devices, pairs them, writes the requested number of 960-byte ordinary records, searches, exports a full vault and reopens the encrypted database. Temporary directories are removed on exit. Output is JSONL; no real vault or cloud account is used. The default cases are 100 and 1000 assets.

    Local Windows x86_64 / Rust 1.98.1 MSVC observations on 2026-09-17:

    Assets Save p50 / p95 (ms) Search (ms) Unlock (ms) Database bytes Full sync response bytes Cumulative serialized state bytes written
    10 5.96 / 7.20 10.29 146.45 147456 57255 297346
    100 8.56 / 13.06 42.39 206.50 1126400 509912 21224694
    1000 56.75 / 108.40 252.95 825.76 9175040 4162849 2038518604

    The audit append path previously derived the same device public key once for every existing audit entry. Computing it once per append preserves the signed chain while removing repeated cryptographic work. Before this change, the same 100/1000-record searches measured 552.71/2476.66 ms. These are single local runs, not statistically controlled measurements or cross-platform guarantees; other validation/build work ran on the host.

    serialized_state_bytes_written sums the encrypted state row length after each asset insertion. It excludes checkpoints, journals, filesystem amplification and later search/export writes; it is not a physical disk-write counter. Export size includes its JSON response. Search returns at most 100 results. Peak memory, large binary assets, multi-device fanout and mobile latency still need profiling.

    Completed cloud uploads/downloads now drop their ciphertext buffers while retaining small replay receipts and publication stamps. Queue capacity applies to pending work. Remote history and compact local hash receipts are retained; no cloud deletion or offline-device acknowledgement is inferred from upload success.

    The cumulative write volume confirms that whole-state persistence remains a small-library design. Encrypted per-revision rows and incremental transport are a separate format/migration change, with backup and rollback validation required before replacing the existing transactional format. Use these reproducible measurements to set a supported size and release latency budget first.