-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add benchmark for DynamoDB serialization/deserialization #507
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if intentionally or unintentionally, you're actually testing a lot more than just the serializers. If you just want to benchmark the serializer, I would write something much closer to what the protocol tests generate and use make_operation
and ParseResponse
directly. (Note that in the case of dynamo, you can use ParseStrictResponse
since none of the responses are streaming)
Definitely was unintentionally testing more than I wanted to, but I wasn't aware of how to do the parsing directly. Thanks for the pointers! I updated the PR with a much nicer implementation that should give us better information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, removing async will also simplify things.
We should also add the benches folder to the copy step in build.gradle so that CI will at least compile these
use smithy_http::response::ParseHttpResponse; | ||
use tokio::runtime::Builder as RuntimeBuilder; | ||
|
||
async fn do_bench() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function actually doesn't need to be async
}; | ||
} | ||
|
||
async fn do_bench(config: &Config, input: &PutItemInput) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also doesn't need to be async anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -240,7 +245,7 @@ tasks.register<Exec>("cargoCheck") { | |||
workingDir(sdkOutputDir) | |||
// disallow warnings | |||
environment("RUSTFLAGS", "-D warnings") | |||
commandLine("cargo", "check") | |||
commandLine("cargo", "check", "--lib", "--tests", "--benches") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since CI doesn't actually hit this, we should also update the CI job
More work towards #161. This adds a benchmark for JSON serialization/deserialization for real-world DynamoDB calls.
Sample output:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.