ywxzm03 opened a new pull request, #3414:
URL: https://github.com/apache/dubbo-go/pull/3414

   **What this PR does**
   
   Adds conservative capacity preallocation for temporary maps in 
`ServiceInstancesChangedListenerImpl.OnEvent` to reduce dynamic map growth 
while processing service instance change events.
   
   Specifically:
   
   - `revisionToInstances` and `newRevisionToMetadata` are preallocated with 
`len(lstn.revisionToMetadata)`.
   - `serviceToRevisionServices` is preallocated with `len(lstn.serviceUrls)`.
   - `newServiceURLs` is moved closer to where it is built and preallocated 
with `len(serviceToRevisionServices)`, since their keys correspond one-to-one.
   
   These changes only affect the initial capacity of temporary collections. 
They do not change the refresh algorithm, metadata loading behavior, or 
listener notification semantics.
   
   **Which issue(s) this PR fixes**:
   Fixes #3409


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