Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

chore: create and reuse a base CallContext#3816

Merged
olavloite merged 2 commits intomainfrom
base-grpc-call-context
Apr 15, 2025
Merged

chore: create and reuse a base CallContext#3816
olavloite merged 2 commits intomainfrom
base-grpc-call-context

Conversation

@olavloite
Copy link
Copy Markdown
Collaborator

@olavloite olavloite commented Apr 11, 2025

Every RPC that is executed by the client needs to create a new CallContext. Some of the settings in this CallContext is the same for all calls, and there is no need to create a new one completely from scratch for the properties that are the same for all calls. This change creates a base CallContext that is reused as the base for all RPCs.

Each of the withSomething(..) methods in GrpcCallContext creates a new GrpcCallContext. Skipping as many of these withSomething(..) calls in each request therefore saves a bit of memory allocation.

Every RPC that is executed by the client needs to create a new CallContext. Some
of the settings in this CallContext is the same for all calls, and there is no
need to create a new one completely from scratch for the properties that are the
same for all calls. This change creates a base CallContext that is reused as the
base for all RPCs.
@olavloite olavloite requested review from a team April 11, 2025 14:48
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Apr 11, 2025
@olavloite olavloite merged commit 8919c5e into main Apr 15, 2025
34 checks passed
@olavloite olavloite deleted the base-grpc-call-context branch April 15, 2025 07:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants