Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
ReadBlobcurrently unquotes every JSON string and copies it into a temporary string before base64 decoding. The parser has already checked for escapes, so ordinary unescaped blobs incur a redundant scan and copy.Decode unescaped base64 directly from the token bytes with
AppendDecode. Escaped strings still pass throughUnquoteBytes. The decoded result owns its storage, empty strings produce non-nil empty slices, and decoding failures leave the destination unchanged.The Kinesis
GetRecordsbenchmark exercises the actual SDK client, middleware, response buffering, JSON parsing, and blob decoding through a mock HTTP client. Each fixture's decoded bytes are verified before timing. Median results from six alternating baseline/candidate trials:Go 1.26.2, Apple M4, darwin/arm64,
GOMAXPROCS=4, 500 ms per sub-benchmark. The small-response timing difference is not statistically significant. These generated workloads exclude network latency and AWS service processing; timing variability is included in the reproduction instructions, benchmark source, and raw results.Validation:
GOMAXPROCS=4 make unit-race: all module vet and race checks passed.FuzzReadBlob: 2,448,545 executions over 30 seconds, comparing decoded bytes, nil/empty results, and base64 error offsets withencoding/json.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.