We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d55fc1 commit 15b9ec8Copy full SHA for 15b9ec8
1 file changed
core/src/main/java/io/grpc/internal/DelayedClientTransport.java
@@ -316,7 +316,11 @@ final void reprocess(@Nullable SubchannelPicker picker) {
316
if (!hasPendingStreams()) {
317
return;
318
}
319
- pendingStreams.removeAll(toRemove);
+ // Avoid pendingStreams.removeAll() as it can degrade to calling toRemove.contains() for each
320
+ // element in pendingStreams.
321
+ for (PendingStream stream : toRemove) {
322
+ pendingStreams.remove(stream);
323
+ }
324
// Because delayed transport is long-lived, we take this opportunity to down-size the
325
// hashmap.
326
if (pendingStreams.isEmpty()) {
0 commit comments