Repository navigation
refactor(trie-router): trade registration speed for bundle size - #5238
Merged
usualoma merged 1 commit intoAug 16, 2026
Conversation
Member
Author
|
Hi @yusukebe, This change makes route registration approximately 5.5% slower, while our benchmarks show no regression in matching performance. For TrieRouter specifically, I think the 271-byte reduction is a worthwhile trade-off for Hono. Do you think this trade-off is acceptable? |
Member
|
The code I wrote a long time ago is being cleaned up, haha!
Yes. File size reduction is the No.1 priority for TrieRouter. Can you merge those PRs into #5236? |
usualoma
merged commit Aug 16, 2026
6bfcb5c
into
refactor/trie-router-reduce-bundle-size
2 checks passed
3 tasks done
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.
This is a follow-up to the previous TrieRouter bundle-size reduction.
Important
This PR intentionally trades approximately 5.5% slower route registration for a smaller bundle. Matching benchmarks showed no meaningful performance regression.
It further reduces the bundle size by storing pattern metadata on child nodes and simplifying the route-registration path.
The author should do the following, if applicable
bun run format:fix && bun run lint:fixto format the code