chore(benchmark): update the handle-event benchmark (#1297)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* chore(benchmark): update the handle-event benchmark * denoify
authored by Yusuke Wada · committed by GitHub · parent 8e2eaf9 · Browse files · 3 files·+20 added−20 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+20 added−20 removed
- other:+20 added−20 removed
Provenance
- Commit
4a3c583- Tree
4a636b9- Author
Yusuke Wada <yusuke@kamawada.com>- Committer
GitHub <noreply@github.com>- Parent
8e2eaf9
3 files changed+20 added−20 removed
modified:benchmarks/handle-event/index.js+10 added-10 removed
9 unmodified lines1011121314151617181920212214151617181920212223242425262728121 unmodified linesExpand all9 unmodified linesglobalThis.Request = RequestglobalThis.Response = Response
const initHono = (hono) => { hono.get('/user', () => new Response('User')) hono.get('/user/comments', () => new Response('User Comments')) hono.get('/user/avatar', () => new Response('User Avatar')) hono.get('/user/lookup/email/:address', () => new Response('User Lookup Email Address')) hono.get('/event/:id', () => new Response('Event')) hono.get('/event/:id/comments', () => new Response('Event Comments')) hono.post('/event/:id/comments', () => new Response('POST Event Comments')) hono.post('/status', () => new Response('Status')) hono.get('/very/deeply/nested/route/hello/there', () => new Response('Very Deeply Nested Route')) hono.get('/user', (c) => c.text('User')) hono.get('/user/comments', (c) => c.text('User Comments')) hono.get('/user/avatar', (c) => c.text('User Avatar')) hono.get('/user/lookup/email/:address', (c) => c.text('User Lookup Email Address')) hono.get('/event/:id', (c) => c.text('Event')) hono.get('/event/:id/comments', (c) => c.text('Event Comments')) hono.post('/event/:id/comments', (c) => c.text('POST Event Comments')) hono.post('/status', (c) => c.text('Status')) hono.get('/very/deeply/nested/route/hello/there', (c) => c.text('Very Deeply Nested Route')) hono.get('/user/lookup/username/:username', (c) => { return new Response(`Hello ${c.req.param('username')}`) return c.text(`Hello ${c.req.param('username')}`) }) return hono}
121 unmodified linesExpand allmodified:deno_dist/README.md+5 added-5 removed
56 unmodified lines57 58 **Hono is the fastest**, compared to other routers for Cloudflare Workers.59 60 ```61-Hono x 402,820 ops/sec ±4.78% (80 runs sampled)62-itty-router x 212,598 ops/sec ±3.11% (87 runs sampled)63-sunder x 297,036 ops/sec ±4.76% (77 runs sampled)64-worktop x 197,345 ops/sec ±2.40% (88 runs sampled)61+Hono x 510,171 ops/sec ±4.61% (82 runs sampled)62+itty-router x 285,810 ops/sec ±4.13% (85 runs sampled)63+sunder x 345,272 ops/sec ±4.46% (87 runs sampled)64+worktop x 203,468 ops/sec ±3.03% (91 runs sampled)65 Fastest is Hono66-✨ Done in 28.06s.66+✨ Done in 28.68s.67 ```68 69 ## Documentation70 35 unmodified linesmodified:README.md+5 added-5 removed
56 unmodified lines57 58 **Hono is the fastest**, compared to other routers for Cloudflare Workers.59 60 ```61-Hono x 402,820 ops/sec ±4.78% (80 runs sampled)62-itty-router x 212,598 ops/sec ±3.11% (87 runs sampled)63-sunder x 297,036 ops/sec ±4.76% (77 runs sampled)64-worktop x 197,345 ops/sec ±2.40% (88 runs sampled)61+Hono x 510,171 ops/sec ±4.61% (82 runs sampled)62+itty-router x 285,810 ops/sec ±4.13% (85 runs sampled)63+sunder x 345,272 ops/sec ±4.46% (87 runs sampled)64+worktop x 203,468 ops/sec ±3.03% (91 runs sampled)65 Fastest is Hono66-✨ Done in 28.06s.66+✨ Done in 28.68s.67 ```68 69 ## Documentation70 35 unmodified lines