Skip to content
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

fix: When passing a sub-array (offset, length) to the Storage#create method the array is needlessly cloned #506

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

benbenw
Copy link
Contributor

@benbenw benbenw commented Sep 14, 2020

leading to unnecessary memory allocations.

No new tests as it was already covered.

Signed-off-by: benoit b.wiart@ubik-ingenierie.com

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #505 ☕️

@google-cla
Copy link

google-cla bot commented Sep 14, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Sep 14, 2020
@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #506 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #506      +/-   ##
============================================
+ Coverage     64.69%   64.71%   +0.02%     
+ Complexity      629      620       -9     
============================================
  Files            32       32              
  Lines          5249     5252       +3     
  Branches        509      510       +1     
============================================
+ Hits           3396     3399       +3     
  Misses         1694     1694              
  Partials        159      159              
Impacted Files Coverage Δ Complexity Δ
...ain/java/com/google/cloud/storage/StorageImpl.java 81.31% <100.00%> (+0.06%) 138.00 <0.00> (-9.00) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10cc743...25197b3. Read the comment docs.

@benbenw
Copy link
Contributor Author

benbenw commented Sep 14, 2020

@googlebot I signed it!

@google-cla google-cla bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 14, 2020
@athakor athakor changed the title When passing a sub-array (offset, length) to the Storage#create method the array is needlessly cloned fix: When passing a sub-array (offset, length) to the Storage#create method the array is needlessly cloned Sep 14, 2020
@athakor athakor added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Sep 14, 2020
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Sep 14, 2020
the array is needlessly cloned leading to unnecessary memory
allocations.

Signed-off-by: benoit <b.wiart@ubik-ingenierie.com>
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 14, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 14, 2020
@frankyn
Copy link
Member

frankyn commented Sep 14, 2020

Thanks @benbenw, pending CI passing and then it should merge.

@frankyn frankyn added the automerge Merge the pull request once unit tests and other checks pass. label Sep 14, 2020
@gcf-merge-on-green gcf-merge-on-green bot merged commit 9415bb7 into googleapis:master Sep 14, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Storage : Reduce memory allocations when creating a blob from a sub-array
4 participants