perf(app): skip awaiting the boot in app.fetch once it has finished #178

Merged
chrnx merged 1 commits from perf/fetch-skip-boot-await into develop 2026-10-29 03:06:36 +00:00
1 Commits
Author SHA1 Message Date
chrnx d51ff3bee4 perf(app): skip awaiting the boot in app.fetch once it has finished
CI / dco (pull_request) Successful in 5s
CI / runtimes (bun) (pull_request) Successful in 21s
CI / build (pull_request) Successful in 29s
CI / runtimes (edge) (pull_request) Successful in 23s
CI / runtimes (deno) (pull_request) Successful in 33s
trackHealth wraps the memoized boot in an async function, so every
app.fetch request paid a new promise and microtask hops awaiting a boot
that had already settled. A built route table means the boot succeeded,
so the fetch handler now goes straight to it; only requests before the
table exists await the boot. A failed boot still rejects every request,
because the table is never built.

Measured in-process on Deno (app.fetch in a loop, param route): about
+3-6%.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-28 20:31:18 -05:00