awslabs / aws-c-s3

C99 library implementation for communicating with the S3 service, designed for maximizing throughput on high bandwidth EC2 instances.
Apache License 2.0
94 stars 38 forks source link

Skip headRequest for RangeGet Part 1 #389

Closed waahm7 closed 8 months ago

waahm7 commented 9 months ago

Description of changes: This approach skips the head request when checksum verification is enabled and size_hint indicates that it is a one-part file by replacing it with a getPart request. We cancel the request if the content length of the first part is greater than part_size. This method helps us avoid extra requests for objects with content_length <= part_size.

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

codecov-commenter commented 9 months ago

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (20097d3) 88.99% compared to head (2189eda) 89.05%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389/graphs/tree.svg?width=650&height=150&src=pr&token=J4KP54FVLF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs)](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs) ```diff @@ Coverage Diff @@ ## main #389 +/- ## ========================================== + Coverage 88.99% 89.05% +0.06% ========================================== Files 21 21 Lines 6043 6160 +117 ========================================== + Hits 5378 5486 +108 - Misses 665 674 +9 ``` | [Files](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs) | Coverage Δ | | |---|---|---| | [source/s3.c](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL3MzLmM=) | `95.65% <ø> (ø)` | | | [source/s3\_meta\_request.c](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL3MzX21ldGFfcmVxdWVzdC5j) | `92.23% <100.00%> (+0.14%)` | :arrow_up: | | [source/s3\_auto\_ranged\_get.c](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL3MzX2F1dG9fcmFuZ2VkX2dldC5j) | `97.76% <95.96%> (-0.53%)` | :arrow_down: | | [source/s3\_util.c](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL3MzX3V0aWwuYw==) | `98.02% <88.63%> (-1.61%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/awslabs/aws-c-s3/pull/389/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs)