Skip to content

feat: Adding support of single shot download #1493

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

Merged

Conversation

shubham-up-47
Copy link
Contributor

@shubham-up-47 shubham-up-47 commented Jun 19, 2025

Adding the support of single shot download using a boolean flag.

Some results using the script in the customer issue,

  • Download speed with single_shot_download=false (default value) = 123 MB / sec
  • Download speed with single_shot_download=true = 273 MB / sec
  • RawDownload speed with single_shot_download=false (default value) = 131 MB / sec
  • RawDownload speed with single_shot_download=true = 289 MB / sec

@shubham-up-47 shubham-up-47 requested review from a team as code owners June 19, 2025 14:18
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/python-storage API. labels Jun 19, 2025
@chandra-siri
Copy link
Contributor

@shubham-up-47 Please add unit tests.

@shubham-up-47 shubham-up-47 added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 23, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 23, 2025
@shubham-up-47
Copy link
Contributor Author

@shubham-up-47 Please add unit tests.

Done.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jun 23, 2025
@shubham-up-47 shubham-up-47 changed the title feat(storage): Adding support of single shot download feat: Adding support of single shot download Jun 24, 2025
@shubham-up-47
Copy link
Contributor Author

Nit: Also please follow https://www.conventionalcommits.org/en/v1.0.0/#specification , we don't need (storage) , unlike C++ where it's a mono-repo

Done. Noted.

chandra-siri
chandra-siri previously approved these changes Jun 24, 2025
chandra-siri
chandra-siri previously approved these changes Jun 24, 2025
Copy link
Contributor

@danielduhh danielduhh left a comment

Choose a reason for hiding this comment

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

Design question: why put this behind an opt-in flag? Is there a non backwards compatible change that you're concerned about? Or is the flag temporary?

This requires a customer to take an extra step in order to benefit from the performance optimization.

@shubham-up-47
Copy link
Contributor Author

Design question: why put this behind an opt-in flag? Is there a non backwards compatible change that you're concerned about? Or is the flag temporary?

This requires a customer to take an extra step in order to benefit from the performance optimization.

We wanted to keep the existing flow as it is and add the support of single_shot_download, that's why keeping its default value as False currently.

Later if everything works fine, then we will make the default value of single_shot_download flag as true.

@chandra-siri chandra-siri requested a review from cojenco June 25, 2025 13:30
Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

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

Left a few questions. Please also add system tests under TestRawDownload as well, thanks!

:param single_shot_download:
(Optional) If true, download the object in a single request.
Caution: Enabling this will increase the memory overload for your application.
Please enable this as per your use case.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the note on memory consumption.

Based on the design doc, I understand we are introducing single shot download support in multiple phases. Note that if and when we want to have single_shot_download defaulted to True, that would be a breaking change and would require a major version bump, so something to keep in mind when planning for next version changes

Copy link
Contributor

Choose a reason for hiding this comment

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

@cojenco how is that a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure @cojenco, will keep these things in mind.

@shubham-up-47
Copy link
Contributor Author

shubham-up-47 commented Jun 27, 2025

Left a few questions. Please also add system tests under TestRawDownload as well, thanks!

Done, Actually TestRawDownload is inheriting the TestDownload class, that's why all the tests written in the TestDownload class are automatically running for the TestRawDownload class.

https://screenshot.googleplex.com/4GYUPuXSXVkT7uh

@chandra-siri chandra-siri self-requested a review June 30, 2025 07:36
@cojenco cojenco added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 30, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 30, 2025
@shubham-up-47 shubham-up-47 merged commit 61c5d5f into googleapis:main Jul 1, 2025
15 checks passed
@shubham-up-47 shubham-up-47 deleted the enable-single-shot-download branch July 1, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants