perf(router): reset the walk stack only when a lookup throws (#109) #131

Merged
chrnx merged 1 commits from fix/router-walk-stack-reset into develop 2026-10-12 20:10:46 +00:00
1 Commits
Author SHA1 Message Date
chrnx 1b30f15c02 perf(router): reset the walk stack only when a lookup throws
CI / dco (pull_request) Successful in 4s
CI / runtimes (bun) (pull_request) Successful in 16s
CI / build (pull_request) Successful in 26s
CI / runtimes (edge) (pull_request) Successful in 14s
CI / runtimes (deno) (pull_request) Successful in 19s
The finally block added in a2b71e2 wrote both stacks' length on every
lookup, which drops their backing storage and made every walked lookup
pay for reallocation: +50% late param hit, +33% method miss and +104%
path miss at 10 routes on jarvis (CARD-10). A normal walk already ends
at base, so reset only in a catch and rethrow.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-12 14:27:24 -05:00