Alanxtl opened a new issue, #3393: URL: https://github.com/apache/dubbo-go/issues/3393
### Background `URL.String()` is used in logging, registry, protocol, and comparison paths. It currently does read-only work but still takes the params write lock, and it builds the URL prefix through formatting before appending encoded params. This path can be made cheaper and less blocking while preserving current output. Related to #3248. ### Scope Optimize `common.URL.String()`: - Use `paramsLock.RLock()` instead of the write lock because the method only reads params. - Build the URL prefix with `strings.Builder` / `Grow` / `WriteString` instead of formatting into an intermediate string. - Preserve existing string output exactly, including behavior when there are no query params. - Keep `params.Encode()` behavior unless a benchmark-backed alternative is introduced with equivalent ordering semantics. ### Acceptance criteria - Existing `common` tests continue to pass. - Add or update URL string benchmarks so the PR can show allocation/throughput impact with `-benchmem`. - No behavior change to URL formatting. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
