Skip to content

perf(api): minimize cold isolate initialization - #594

Merged
Makisuo merged 1 commit into
perf/api-lazy-http-routesfrom
perf/api-cold-bootstrap
Aug 23, 2026
Merged

perf(api): minimize cold isolate initialization#594
Makisuo merged 1 commit into
perf/api-lazy-http-routesfrom
perf/api-cold-bootstrap

Conversation

@Makisuo

@Makisuo Makisuo commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace startup-time reflection over every domain HTTP error with a checked-in generated identifier list plus drift test.
  • Serve /health and OPTIONS without loading routes, services, auth, database, or telemetry.
  • Parallelize independent cold imports and MCP session loading; reuse immutable request context.
  • Let failed handler/RPC initialization recover on a later request and remove the redundant telemetry macrotask.

Benchmark

Relative to the preceding stack layer:

  • workerd active startup CPU: 117.8 ms → 30.7 ms (-73.9%).
  • desktop startup heap proxy: 30.85 MB → 5.03 MB (-83.7%).
  • compressed bundle: 2,544.19 KiB → 2,534.29 KiB.
  • cold GET /health, five-run median: 125.6 ms → 7.4 ms (-94.1%).
  • the cold real-route combined local proxy stays flat (246.8 ms → 248.2 ms): schema work moves from startup into the first real request instead of disappearing.

Verification

  • API and domain typechecks passed.
  • CORS fast-path tests: 2 passed.
  • Anticipated-error tests: 4 passed; generated output check passed (111 identifiers).
  • Vendored Effect HTTP API tests: 48 passed.

Stack: 2/3. Based on #593; followed by #595.

Stack created with GitHub Stacks CLIGive Feedback 💬

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@Makisuo
Makisuo merged commit 61adae6 into main Aug 23, 2026
2 checks passed
@Makisuo
Makisuo deleted the perf/api-cold-bootstrap branch August 23, 2026 14:00
@Makisuo
Makisuo deployed to pr-preview August 23, 2026 14:00 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown

🍁 Maple PR preview

Note

Preview resources were removed when this pull request closed.

Final commit 946a63f · View workflow run

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