kimmking edited a comment on issue #2578: The current RoundRobinLoadBalance 
implementation performance is not satisfactory
URL: 
https://github.com/apache/incubator-dubbo/issues/2578#issuecomment-425622651
 
 
   In your case 1:
   Invoking currentSelect-method 1M times lead to 1833832000 times calc, cause:
   ```
   for (int i = 0; i < maxWeight; i++) { // this is the reason
        for (Map.Entry<Integer, IntegerWrapper> each : 
invokerToWeightMap.entrySet()) {
                       ....
        }
   }
   ```
   
   If we modify the weight array to {100, 100, 200, 200, 300, 300, 400, 400, 
500, 5000};
   It need 60+s to finish it.
   
   So we must optimize this RR algorithm.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to