Skip to content

refactor: Reduce TrieRouter bundle size without a meaningful performance regression - #5237

Merged
usualoma merged 4 commits into
fix/trie-router-suffix-wildcardfrom
refactor/trie-router-reduce-bundle-size
Aug 16, 2026
Merged

usualoma merged 4 commits into
fix/trie-router-suffix-wildcardfrom
refactor/trie-router-reduce-bundle-size

Conversation

@usualoma

Copy link
Copy Markdown
Member

This is a follow-up to the suffix wildcard fix (#5236).

This PR reduces TrieRouter's minified bundle size without a meaningful performance regression. It removes unused initialization paths and simplifies internal matching bookkeeping.

It also fixes an insertion-order edge case: when /assets*/x is registered before /assets*, the suffix wildcard pattern still needs to be registered on the existing child node.

TrieRouter bundle Before After Difference
Minified 3,340 B 3,064 B -276 B
Minified + gzip 1,658 B 1,533 B -125 B

Benchmarks showed no meaningful performance regression.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code

@usualoma
usualoma merged commit 7c7958f into fix/trie-router-suffix-wildcard Aug 16, 2026
2 checks passed
@usualoma
usualoma deleted the refactor/trie-router-reduce-bundle-size branch August 16, 2026 23:39
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.

1 participant