Skip to content

perf: reduce server response latency and improve perceived performance - #81

Merged
jhoffner merged 1 commit into
mainfrom
fix/kitchen-sink-performance
Mar 13, 2026
Merged

jhoffner merged 1 commit into
mainfrom
fix/kitchen-sink-performance

Conversation

@jhoffner

Copy link
Copy Markdown
Collaborator

Summary

  • Parallelize store operations in createExecutionContext — 4 sequential await calls become a single Promise.all(), reducing context creation time
  • Emit SSE events earlier — request status and user message are emitted before createExecutionContext, so the client receives first events faster
  • Optimistic user message rendering — useSession.sendAction accepts an optional userMessage string and immediately renders it client-side before the server round-trip
  • Debounce refreshSnapshot on resource_change events (300ms) — batches rapid resource writes (working memory + artifacts) into a single snapshot refresh

Test plan

  • All 468 tests pass across all packages
  • Typecheck passes for all packages
  • Manual test: send a message in Kitchen Sink and verify the user message appears instantly
  • Manual test: verify assistant response streams correctly after optimistic message
  • Manual test: verify resource changes (artifacts, working memory) still update client data

🤖 Generated with Claude Code

- Parallelize store operations in createExecutionContext (user, session,
  project, request records load concurrently via Promise.all)
- Emit request status and user message before createExecutionContext so
  the SSE stream delivers first events faster
- Add optimistic user message rendering in useSession (shows user's own
  message instantly before server round-trip)
- Debounce refreshSnapshot on resource_change events (300ms) to batch
  rapid resource writes into a single refresh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flow-state-dev-docs Building Building Preview, Comment Mar 13, 2026 10:15pm
flow-state-dev-kitchen-sink Building Building Preview, Comment Mar 13, 2026 10:15pm

This branch was successfully deployed

2 active deployments
Preview – flow-state-dev-kitchen-sink — d335f533 Deployed Mar 13, 2026 by vercel[bot]
Preview – flow-state-dev-docs — d335f533 Deployed Mar 13, 2026 by vercel[bot]
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