Skip to content

perf: cache journal entries, parallel loading, boot warmup for search - #32

Closed
Ghilteras wants to merge 1 commit into
joshuadavidthomas:mainfrom
Ghilteras:feat/journal-search-cache
Closed

perf: cache journal entries, parallel loading, boot warmup for search#32
Ghilteras wants to merge 1 commit into
joshuadavidthomas:mainfrom
Ghilteras:feat/journal-search-cache

Conversation

@Ghilteras

Copy link
Copy Markdown

Problem

Every search re-reads and re-parses every entry and loads embeddings serially. With a growing journal, each search pays full O(N) disk I/O plus cold model load after each process start.

Solution

  • Add a per-store fingerprinted cache for parsed journal entries and plain-array sidecars.
  • Stat entry and sidecar files in parallel, load cache misses in parallel, and gracefully skip malformed entries.
  • Warm the embedding model at boot after configuration is read and only inside the journal-enabled feature branch.

Not included

Tested

  • bun test (29 pass, 0 fail)
  • bun run typecheck (exit 0)

This ships in our fork since v0.4.1, with one hardening fix from review: warmup must run after config and inside the feature branch. The transformers.js-style singleton is first-init-wins.

@Ghilteras Ghilteras closed this Sep 5, 2026
@Ghilteras
Ghilteras deleted the feat/journal-search-cache branch September 5, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant