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

RPCv2 performance improvements. #5535

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

sugmanue
Copy link
Contributor

@sugmanue sugmanue commented Aug 26, 2024

Motivation and Context

Adds some performance improvements changes to improve the RPCv2 protocol, including:

Allow reading numbers without parsing

CBOR encodes numbers that are faster to read from its encoded form than converting them to strings and then parsing them back. For that we changed 1) the way we parse to return embedded objects when appropriate, and, 2) the way we unmarshall to support numbers as embedded objects, we also changed the way Instant is unmarshalled as in CBOR that's done as a number.

Faster lookups for unmarshallers

We keep a map in AbstractMarshallingRegistry to register different

. This map is used heavily during unmarshalling to find which unmarshall to use for each value.

to store, keyed on MarshallngType, to register unmarshallers for different types, however the types that we care about are static and known at compile time, this allow us to make an optimization, add an enum key to each of the known MarshallngType that we care about and index those using this enum to use EnumMap that has better performance than regular maps, and, fallback to use a regular map for the marshalling types that are not know.

Modifications

to find the unmarshaller for the given type, and, on Trait.class to find traits stored in the SdkField instances. To improve the performance of both we rely on the fact that both classes have a known set of static values that we care about,

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

* Add support to serialize byte values

* Add tests for byte support

* Address PR comments
* Add support to serialize byte values

* Add RPCv2 protocol core marshalling/unmarshalling

* Address PR comments

* Address PR comments 2

* Address PR comments 3
* Support for operation without input defined

* Fix a checkstyle issue

* Code clean up

* Code clean up 2

* Rewrite the condition to conjunctive normal form
* Add codgen tests

* Address PR comments

* Address PR comments 2

* Add missing class rename

* Add missing AWS_JSON protocol facts

* Account for null protocol case
* Add RPCv2 benchmark tests

* Give the constants name a meaningful name
Copy link

sonarcloud bot commented Aug 27, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
50.1% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Base automatically changed from feature/master/rpcv2-cbor to master September 24, 2024 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant