Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove async from dispatch; will be 16% faster #550

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

yusukebe
Copy link
Member

@yusukebe yusukebe commented Sep 24, 2022

Remove async from dispatch function in hono.ts. A single handler that does not use async will be about 16% faster on Bun:

v2.2.1:

Reqs/sec    158951.18   43864.54  202188.36
Latency        1.26ms     1.39ms    41.26ms
HTTP codes:
1xx - 0, 2xx - 1589211, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput:    21.67MB/s

This PR:

Reqs/sec    188225.08   24307.40  218436.45
Latency        1.06ms   109.58us    12.83ms
HTTP codes:
1xx - 0, 2xx - 1880915, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput:    25.65MB/s

SS

SS

This benchmark using: https://github.com/SaltyAom/bun-http-framework-benchmark

@yusukebe yusukebe merged commit e4c8a6f into main Sep 26, 2022
@yusukebe yusukebe deleted the perf/remove-async-dispatch branch September 26, 2022 12:12
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.

None yet

1 participant