perf(serve): seed web timeline from SQLite; non-blocking startup (0.1.1)#31
Merged
Conversation
The web dashboard took ~12s to open on large installs because `serve` started with an empty ring and waited on every adapter's synchronous file backfill, blocking the event loop ~10s. - serve now seeds the ring from store.listRecentEvents() on startup (the TUI already did this), so /api/events has data immediately (~0.5s responsive). - adapters start on the next tick so the server answers requests first. - per-file backfill window 4MB -> 512KB (history comes from the store now). - /api/events limit clamped 50000 -> 2000 to avoid huge payloads. Measured on a ~1GB history: first /api/events 12.1s -> 1.4s.
mishanefedov
added a commit
that referenced
this pull request
May 25, 2026
perf(serve): seed web timeline from SQLite; non-blocking startup (0.1.1)
mishanefedov
added a commit
that referenced
this pull request
May 25, 2026
perf(serve): seed web timeline from SQLite; non-blocking startup (0.1.1)
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
servestarted with an empty in-memory ring and waited on every adapter's synchronous file backfill, blocking the event loop ~10s.servenow seeds the ring fromstore.listRecentEvents()on startup (the TUI already did this) — data is available immediately./api/eventslimitclamped 50000 → 2000 to avoid multi-hundred-MB responses.Test plan
npm run typecheckcleannpm test— 404 passednpm run buildOK/api/events?limit=10012.1s → 1.4s