googleapis / googleapis/google-cloud-java

[sdk-platform-java] Speed up channel pool creation by parallelizing the creation of the channels

Open
#12,497 0 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

**Is your feature request related to a problem? Please describe.**
When a channel pool is large and channel priming is enabled, it could take a long time to instantiate a client. This happens because the channels are created serially with the primer application inline:

https://github.com/googleapis/sdk-platform-java/blob/cc5724f04722e3d60eb9b4e02ecc1bdf5dd7a7fa/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java#L106-L108

https://github.com/googleapis/sdk-platform-java/blob/cc5724f04722e3d60eb9b4e02ecc1bdf5dd7a7fa/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java#L392-L393

**Describe the solution you'd like**
I think having the ChannelPool constructor create a temporary ForkJoin pool to invoke createSingleChannel would drastically improve start up times.

Internal issue: b/283099177

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.