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

feat: refactor rpcinfo to eliminate useless unwrap #284

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

PureWhiteWu
Copy link
Member

Motivation

Previously, all the fields in volo::context::RpcInfo are Option, which may lead to many useless unwrap calls and this can lead to a lot of branch prediction.

Solution

This PR removes the Option, and can slightly improve the performance.

Note this is a BREAKING CHANGE.

@PureWhiteWu PureWhiteWu added A-volo This issue concerns the main`volo` crate. A-volo-build This issue concerns the `volo-build` crate. A-volo-grpc This issue concerns the `volo-grpc` crate. A-volo-thrift The issue concerns the `volo-thrift` crate. C-enhancement This is a PR that adds a new feature or fixes a bug. labels Dec 13, 2023
@PureWhiteWu PureWhiteWu self-assigned this Dec 13, 2023
@PureWhiteWu PureWhiteWu requested review from a team as code owners December 13, 2023 06:24
@PureWhiteWu PureWhiteWu merged commit 4ea025a into cloudwego:main Dec 13, 2023
9 checks passed
@PureWhiteWu PureWhiteWu deleted the refactor/context branch December 13, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-volo This issue concerns the main`volo` crate. A-volo-build This issue concerns the `volo-build` crate. A-volo-grpc This issue concerns the `volo-grpc` crate. A-volo-thrift The issue concerns the `volo-thrift` crate. C-enhancement This is a PR that adds a new feature or fixes a bug.
Development

Successfully merging this pull request may close these issues.

3 participants