Alanxtl opened a new issue, #3392:
URL: https://github.com/apache/dubbo-go/issues/3392

   ### Background
   
   `URL.CloneWithFilter()` and `URL.MergeURL()` are used in registry, 
directory, configurator, and invoker update flows. These methods currently 
perform multiple map copies and repeated locking through public helper methods. 
That is safe, but it is expensive on hot update paths.
   
   Related to #3248.
   
   ### Scope
   
   Reduce copying and locking in clone/merge paths:
   
   - Keep public `GetParams()` / `CopyParams()` safety semantics unchanged.
   - Introduce internal helpers for copying or merging `url.Values` under a 
single lock where possible.
   - Avoid calling `SetParam` once per key in `CloneWithFilter()` when the new 
URL is still local and not shared.
   - Avoid extra `GetParams()` copies in `MergeURL()` when the code only needs 
to build the merged params map.
   - Preserve multi-value parameter semantics when cloning and merging.
   
   ### Acceptance criteria
   
   - Existing behavior is preserved for clone, filtered clone, and merge.
   - Add tests for multi-value params through `CloneWithFilter()` and 
`MergeURL()` if missing.
   - Add or update benchmarks showing allocation reduction for clone and merge 
cases with `-benchmem`.
   - `go test ./common` passes.
   


-- 
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]

Reply via email to