Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move client serialization into the transport handler #1083

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Dec 16, 2020

Motivation:

Moving the client serialization into transport handler allows us to
get rid of an unspecialized generic handler.

Modifications:

  • Add an 'AnySerializer' and 'AnyDeserializer', this is unfortunate but
    necessary since 'ClientTransport' is generic over 'Request' and
    'Response' rather than their respective (de/)serializer. Changing this
    would involve changing the generic constraints on all of the client call
    objects.
  • Move (de/)serialization into the 'ClientTransport'
  • Add a reverse codec for 'fake' transport

Result:

3.5% fewer instructions in the unary_10k_small_requests benchmark.

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Dec 16, 2020
@glbrntt glbrntt requested a review from Lukasa December 16, 2020 15:45
Motivation:

Moving the client serialization into transport handler allows us to
get rid of an unspecialized generic handler.

Modifications:

- Add an 'AnySerializer' and 'AnyDeserializer', this is unfortunate but
  necessary since 'ClientTransport' is generic over 'Request' and
  'Response' rather than their respective (de/)serializer. Changing this
  would involve changing the generic constraints on all of the client call
  objects.
- Move (de/)serialization into the 'ClientTransport'
- Add a reverse codec for 'fake' transport

Result:

3.5% fewer instructions in the unary_10k_small_requests benchmark.
@glbrntt glbrntt merged commit 31dffb8 into grpc:main Dec 17, 2020
@glbrntt glbrntt deleted the gb-any-serializer branch December 17, 2020 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants