xfy ba8c746a2e perf(matcher): eliminate heap allocations in RadixTree search with sync.Pool
RadixTree.searchLongest previously allocated &MatchResult{} on the
heap every time it encountered a handler-bearing node during tree
traversal — potentially N allocations per lookup with only 1 surviving.

Changes:
- searchLongest now tracks best *RadixNode (stack pointer) instead of
  allocating MatchResult at every handler node
- FindLongestPrefix allocates a single pooled MatchResult via sync.Pool
  only when returning a match
- Add ReleaseMatchResult() for callers to return MatchResult to pool
- LocationEngine.Match releases pooled results after use

Result: 0 B/op, 0 allocs/op on tree traversal benchmarks (sequential
and parallel).
2026-06-04 00:12:52 +08:00
..