[rest.li] Update SimpleLoadBalancer to use for loop instead of Map
When running ODP analysis, we observed that SimpleLoadBalancer.getPotentialClients map collect uses around 4% CPU. Much of this seems Collector.toMap's uniqKeysMapAccumulator. In this scenario, this is performing unnecessary extra computation -- the keys of the Map we are creating come directly from a Set.
The updated implementation avoids the stream(...).collect(Collectors.toMap(...) and directly uses a for loop to populate the Map
[rest.li] Update SimpleLoadBalancer to use for loop instead of Map
When running ODP analysis, we observed that SimpleLoadBalancer.getPotentialClients map collect uses around 4% CPU. Much of this seems Collector.toMap's uniqKeysMapAccumulator. In this scenario, this is performing unnecessary extra computation -- the keys of the Map we are creating come directly from a Set.
The updated implementation avoids the stream(...).collect(Collectors.toMap(...) and directly uses a for loop to populate the Map