You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, Hono on Bun looks like it performs badly. But just go to src/bun/hono.ts and change the export to export default { ...app, host: '127.0.0.1' } (instead of export default app) for an instant 20% speed boost that puts it right up, near the top.
If you're curious, with the above trick, Hattip on Bun performs a bit better than Hono without the trick. If I change the URL parser from new URL to something manual with indexOf and the query parser to a simple regex-based one, it catches up with Hono with the trick. You can go even faster by using other tricks like creating the same "Hi" response once and using clone to duplicate it and creating the options objects once and reusing them. Using a Headers object also seems to be faster. I really don't see much point but I'm designing a new router in any case. I will submit it once it's done anyway.
Also, exercising the same code path repeatedly like in here will show very different performance characteristics compared to a more realistic load profile.
Would be nice to see HatTip at https://github.com/SaltyAom/bun-http-framework-benchmark
Related issue: SaltyAom/bun-http-framework-benchmark#58
The text was updated successfully, but these errors were encountered: