perf(trie-router): improve performance (1.5x ~ 2.0x)#4724
Merged
yusukebe merged 4 commits intohonojs:nextfrom Feb 19, 2026
Merged
perf(trie-router): improve performance (1.5x ~ 2.0x)#4724yusukebe merged 4 commits intohonojs:nextfrom
yusukebe merged 4 commits intohonojs:nextfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #4724 +/- ##
==========================================
- Coverage 91.43% 91.43% -0.01%
==========================================
Files 173 173
Lines 11382 11402 +20
Branches 3300 3307 +7
==========================================
+ Hits 10407 10425 +18
- Misses 974 976 +2
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Covers the constructor branch where method and handler are provided, improving patch coverage to 100% line/statement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@yusukebe Can you review this? |
Member
|
Hey @EdamAme-x This is awesome. You are great since you make my first router (TrieRouter) fast! The file size increases by 73 bytes with the Hello World application after minify.
But I think this is acceptable. Let's go with this! I'll include this in the next minor release |
Contributor
Author
|
Okay! |
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.

How to improve
hasChildrenfromBenchmark Results
imporved vs hono@latest in same process
GET /userGET /user/commentsGET /user/lookup/username/heyGET /event/abcd1234/commentsPOST /event/abcd1234/commentGET /very/deeply/nested/route/hello/thereGET /static/index.htmlThe author should do the following, if applicable
bun run format:fix && bun run lint:fixto format the code