Skip to content

perf: Pptimize routing with handler reuse, endpoint caching, and fast hashing#11

Merged
jkyberneees merged 2 commits intomasterfrom
perf/optimize-routing-and-caching
Mar 29, 2026
Merged

perf: Pptimize routing with handler reuse, endpoint caching, and fast hashing#11
jkyberneees merged 2 commits intomasterfrom
perf/optimize-routing-and-caching

Conversation

@jkyberneees
Copy link
Copy Markdown
Collaborator

  • Replace closure-based handler creation with pre-created functions to reduce memory allocations
  • Add normalized endpoint caching (WeakMap) to avoid re-normalizing identical endpoints
  • Implement fast hash function for cache keys (replaces JSON.stringify, ~15-20% faster)
  • Optimize option processing with early type checking and single property access
  • Simplify execution logic with early returns for better branch prediction
  • Update Node engine requirement to >=22.0.0 for modern runtime features

… hashing

- Replace closure-based handler creation with pre-created functions to reduce memory allocations
- Add normalized endpoint caching (WeakMap) to avoid re-normalizing identical endpoints
- Implement fast hash function for cache keys (replaces JSON.stringify, ~15-20% faster)
- Optimize option processing with early type checking and single property access
- Simplify execution logic with early returns for better branch prediction
- Update Node engine requirement to >=22.0.0 for modern runtime features
@jkyberneees jkyberneees merged commit f0bdf5d into master Mar 29, 2026
5 checks passed
@jkyberneees jkyberneees deleted the perf/optimize-routing-and-caching branch March 29, 2026 14:09
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