Skip to content

Conversation

@jterapin
Copy link
Contributor

@jterapin jterapin commented Dec 6, 2025

This PR intends to improve performance for S3's PutObject and UploadPart .


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

  1. To make sure we include your contribution in the release notes, please make sure to add description entry for your changes in the "unreleased changes" section of the CHANGELOG.md file (at corresponding gem). For the description entry, please make sure it lives in one line and starts with Feature or Issue in the correct format.

  2. For generated code changes, please checkout below instructions first:
    https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md

Thank you for your contribution!

@aws aws deleted a comment from github-actions bot Dec 7, 2025
@aws aws deleted a comment from github-actions bot Dec 7, 2025
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

Detected 1 possible performance regressions:

  • aws-sdk-s3.put_object_small_allocated_kb - z-score regression: 78.62 -> 80.61. Z-score: 1299.81

Comment on lines -12 to +15
MINIMUM_CORE_VERSION = "3.239.1"
MINIMUM_CORE_VERSION = "3.240.0"

# Minimum `aws-sdk-core` version for new S3 gem builds
MINIMUM_CORE_VERSION_S3 = "3.234.0"
MINIMUM_CORE_VERSION_S3 = "3.240.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-reminder to update the minimum core version when this is ready for release.

@jterapin jterapin marked this pull request as ready for review December 8, 2025 17:36
@jterapin jterapin changed the title [WIP] Support S3 unsigned body Support S3 unsigned body Dec 8, 2025
Copy link
Contributor

@richardwang1124 richardwang1124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think it looks good overall to me. Added a few comments.

end

# Trailer implementation within JRUBY environment is facing some
# network issues that will need further investigation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe link to the possible open issue?

@@ -208,6 +208,7 @@ def download_file(destination, bucket:, key:, **options)
# @option option [Integer] :http_chunk_size (16384) Size in bytes for each chunk when streaming request bodies
# over HTTP. Controls the buffer size used when sending data to S3. Larger values may improve throughput by
# reducing the number of network writes, but use more memory. Custom values must be at least 16KB.
# Only Ruby MRI is supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value is still being set on the thread and the patch is being applied right? So the low level http chunk size would still be applied in both cruby and jruby?

if @trailer_io
return @trailer_io.read(length, buf)
def read(length = nil, buf = nil)
return @io.read unless length
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused about this - this means we won't use AWS chunked encoding when we're not given a length?

end

def fill_chunk
chunk = @io.read(@base_chunk_size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens here is fewer (but non-zero) bytes than the base_chunk_size are returned? (I can't 100% remember Ruby, but I think IO objects are allowed to return <= the requested length when the rest of the bytes aren't yet available)

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.

3 participants