You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e4ccd66
Browse filesBrowse the repository at this point in the historyBrowse files
perf(grpc-js): cache precomputed serviceUrl in InternalChannel (#3097)
Cache the precomputed serviceUrl used by call credentials in a bounded two-level cache on InternalChannel instead of re-parsing the method path, splitting the host, and constructing a new template string on every RPC.
- Add zero-allocation `extractServiceName` and `computeServiceUrl` helpers in `uri-parser.ts`.
- Introduce a bounded two-level cache (`serviceUrlCache: Map<string, Map<string, string>>`) on `InternalChannel`, capped at 5 hosts and 100 methods per host to strictly bound memory while achieving zero-allocation lookups on cache hits.
- Clear `serviceUrlCache` when the channel is closed.
- Update `LoadBalancingCall` and `SingleSubchannelChannel` to use the shared URL computation and caching.
0 commit comments