perf(api): benchmark service-bound route workers - #595
Open
Makisuo wants to merge 4 commits into
Open
Conversation
This was referenced Aug 23, 2026
Makisuo
force-pushed
the
perf/api-route-workers
branch
from
August 23, 2026 13:11
ff5ffad to
502792b
Compare
Makisuo
marked this pull request as ready for review
August 23, 2026 13:18
| await fetch(`${baseUrl}/direct`) | ||
| await fetch(`${baseUrl}/bound`) | ||
|
|
||
| const [direct, bound] = await Promise.all([samplePath("/direct"), samplePath("/bound")]) |
There was a problem hiding this comment.
🟡 Concurrent sampling contaminates warm latency numbers
Promise.all([samplePath("/direct"), samplePath("/bound")]) runs both 250-request loops at once, so each stream measures latency while the other loads the same local server. Both the direct baseline and the service-binding number are inflated under doubled load, defeating the comparison the benchmark exists to make.
Suggested change
| const [direct, bound] = await Promise.all([samplePath("/direct"), samplePath("/bound")]) | |
| const direct = await samplePath("/direct") | |
| const bound = await samplePath("/bound") |
Was this helpful? React with 👍 or 👎 to provide feedback.
Makisuo
force-pushed
the
perf/api-route-workers
branch
from
August 23, 2026 13:32
502792b to
4ec17ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Scope
This is a standalone research and planning PR based on
main. It is intentionally not part of the lazy-route and cold-bootstrap optimization stack (#593 and #594), and it does not change production routing.Finding
Hono
HonoBase.route()copies handlers into one in-process router; it does not create route Workers. The matching architecture is the Cloudflare API-gateway and service-binding pattern.Across seven fresh-process runs on the detached branch:
This supports building a functional telemetry Worker canary after #593 and #594 merge. It does not prove production response parity or deployed latency by itself.
Verification
Benchmark method and results:
apps/api/scripts/service-binding-bench/README.md.Implementation and rollout plan:
docs/cloudflare-native-api.md.