GeezerVison is showing github.com — perf(desktop): reduce startup load time by ~95% by justsomelegs · Pull Request #1650 · pingdotgg/t3code
Conversation
justsomelegs
commented
Apr 1, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What Changed
- bootstrap the orchestration engine from projections instead of replaying the full event log on every launch
- keep full event replay as a fallback if the projection snapshot is missing or incomplete
- stop loading thread activities into the in-memory engine bootstrap state
- replace a few startup-time full snapshot reads with targeted projection queries
- bootstrap the UI from a compact orchestration snapshot first, then hydrate the heavier full snapshot afterward
- fall back to the full snapshot if compact bootstrap fails during initial load
So instead of:
- replaying all historical orchestration events
- fetching the full read model immediately just to render the initial UI
startup now:
- restores engine state from projections
- loads a compact snapshot for the sidebar / initial shell
- fills in the heavier full snapshot after that
Why
The main startup bottleneck was that desktop launch was doing far more work than the first screen actually needed.
Before this change:
- backend startup rebuilt orchestration state by replaying the full event history on every launch
- the initial UI bootstrap fetched the full orchestration snapshot even though the sidebar only needed lightweight project/thread state
- a couple of startup-only reads were going through the full snapshot path when targeted projection queries were enough
That meant startup time scaled with accumulated history and spent a lot of time doing work that was not needed to show the initial UI.
This keeps the same behavior, but moves the heavy work off the critical path:
- projections are used for normal bootstrap
- replay is still there as a safety fallback
- the full snapshot still gets hydrated after the app becomes usable
Benchmark context:
- built desktop app, not
dev mode
- same cloned desktop profile for both runs via
T3CODE_HOME
- profile had roughly
699k orchestration events and 73 threads
- Windows 11
- 12th Gen Intel(R) Core(TM) i5-12600K @ 3.70 GHz
- 32 GB RAM @ 3600 MT/s
- NVMe SSD
Benchmarks on the same production-style desktop profile:
main: backend ready in 23.98s
- this branch: backend ready in
1.08s
- delta:
22.91s faster (~95.5% reduction)
The biggest startup stall removed by this PR was:
main: projection bootstrap -> orchestration engine started = 23.06s
- this branch: projection bootstrap -> orchestration engine started =
0.16s
Checklist
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
- I included a video for animation/interaction changes
Note
Reduce desktop startup project load time by ~95% with staged snapshot hydration
- On startup, the UI hydrates from a new lightweight
getBootstrapSnapshot (omitting per-thread messages and activities), then schedules a full getSnapshot to backfill the heavyweight collections.
- The server-side orchestration engine now bootstraps its in-memory read model from the projection snapshot on startup, falling back to full event replay if the snapshot load fails; both paths strip historical thread activities.
- Two new SQL-backed services power the fast path:
ProjectionSnapshotQuery.getBootstrapSnapshot returns a read model without messages/activities, and ProjectionStartupQuery provides lightweight row-count and auto-bootstrap queries used by serverRuntimeStartup.
- The full
getSnapshot and event-replay paths are preserved as fallbacks, so existing behavior is retained if fast-path queries fail.
- Behavioral Change: the orchestration engine no longer includes historical thread activities in the bootstrapped read model at startup.
Macroscope summarized 49dc85f.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Apr 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Important
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9ae143e1-9c6e-4f56-8446-5042b362d3a3
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
justsomelegs
changed the title
Bootstrap orchestration engine from projections
perf(desktop): reduce startup project load time by ~95%
Apr 1, 2026
Uh oh!
There was an error while loading. Please reload this page.
justsomelegs
changed the title
perf(desktop): reduce startup project load time by ~95%
perf(desktop): reduce startup load time by ~95%
Apr 1, 2026
|
Fun timing, i just did this stack last night:
PR1: #1646
PR2: #1647
PR3: #1648
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
justsomelegs
commented
Apr 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fun timing, i just did this stack last night:
PR1: #1646 PR2: #1647 PR3: #1648
oh sick, probably should have double checked before i submitted. you just move to quick to keep up haha
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XL
500-999 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|