Skip to content

perf: defer heavy chat shell renderers#183

Open
0xSolarPunk wants to merge 1 commit into
cfal:mainfrom
0xSolarPunk:codex/perf-smoothness
Open

perf: defer heavy chat shell renderers#183
0xSolarPunk wants to merge 1 commit into
cfal:mainfrom
0xSolarPunk:codex/perf-smoothness

Conversation

@0xSolarPunk

Copy link
Copy Markdown
Contributor

Summary

  • Defers file viewer/editor surfaces from the default app shell so CodeMirror and markdown viewer chunks are not fetched until a file is opened.
  • Defers the rich tool-event renderer until a tool-use message is actually rendered.
  • Collapses chat feed render item construction, tool-result lookup, and permission terminal lookup into one pass over visible messages.

Perf notes

  • Baseline no-chat shell fetched rgxz0B2U.js at 929,406 bytes and afXDL_8X.js at 711,925 bytes.
  • After this change, the no-chat shell no longer fetched the 929 kB CodeMirror chunk; largest initial script observed was D9I-KMdv.js at 650,886 bytes.
  • Opening a chat with tool events still rendered correctly; the after chat-open path loaded the deferred tool-renderer chunk without fetching CodeMirror.
  • Build output server layout chunk dropped from about 1,322 kB to about 1,177 kB.

Evidence

Dogfood report is at /tmp/garcon-dogfood-perf/report.md on the profiling machine.

Validation

  • bun run --cwd web test conversation-feed-items
  • bun run check
  • bun run test
  • timeout 45s bun run start --port 0 --bind-address 127.0.0.1

Startup smoke reached http://0.0.0.0:21369 before the timeout shut down the test server.

Notes

  • Compared against the current OpenAI Codex checkout in /tmp/openai-codex; the relevant design takeaway was to avoid unnecessary work in the steady chat render path, similar to Codex TUI's frame diffing approach.
  • Checked current Svelte 5 source/docs in /tmp/svelte-official; this keeps the change in canonical runes/await-boundary territory.

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