GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: When passing a sub-array (offset, length) to the Storage#create method the array is needlessly cloned by benbenw · Pull Request #506 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Conversation

@benbenw

@benbenw benbenw commented Sep 14, 2020 •
edited by frankyn
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

leading to unnecessary memory allocations.

No new tests as it was already covered.

Signed-off-by: benoit [email protected]

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 ☕️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@google-cla

google-cla Bot commented Sep 14, 2020

Copy link
Copy Markdown

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
  • It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
  • Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
  • The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
  • The email used to register you as an authorized contributor must also be attached to your GitHub account.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

codecov Bot commented Sep 14, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benbenw

benbenw commented Sep 14, 2020

Copy link
Copy Markdown
Contributor Author

@googlebot I signed it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@benbenw
When passing a sub-array (offset, length) to the Storage#create method
25197b3
the array is needlessly cloned leading to unnecessary memory
allocations.

Signed-off-by: benoit <[email protected]>
@benbenw
benbenw force-pushed the byte_offset branch from d0e86f2 to 25197b3 Compare September 14, 2020 13:22
@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
frankyn approved these changes Sep 14, 2020
View reviewed changes
@frankyn

frankyn commented Sep 14, 2020

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@release-please
chore: release 1.113.1 (#500)
69f0094
🤖 I have created a release \*beep\* \*boop\* 
---
### [1.113.1](https://www.github.com/googleapis/java-storage/compare/v1.113.0...v1.113.1) (2020-09-17)


### Bug Fixes

* KMS Bad Key error when using existing Blob context to overwrite object ([#507](https://www.github.com/googleapis/java-storage/issues/507)) ([4d9c490](https://www.github.com/googleapis/java-storage/commit/4d9c49027e4746ee273902694441886c2f43188d))
* When passing a sub-array (offset, length) to the Storage#create method the array is needlessly cloned  ([#506](https://www.github.com/googleapis/java-storage/issues/506)) ([9415bb7](https://www.github.com/googleapis/java-storage/commit/9415bb7bdb42d8012ca457a90070b616e6bbec19)), closes [#505](https://www.github.com/googleapis/java-storage/issues/505)


### Dependencies

* update dependency com.google.apis:google-api-services-storage to v1-rev20200814-1.30.10 ([#499](https://www.github.com/googleapis/java-storage/issues/499)) ([af91d7d](https://www.github.com/googleapis/java-storage/commit/af91d7da4117fb22992d6a860af61f72906e0aa1))


### Documentation

* update libraries-bom ([#504](https://www.github.com/googleapis/java-storage/issues/504)) ([0e58c1c](https://www.github.com/googleapis/java-storage/commit/0e58c1cb2b6a890e567b043188613021592f2bc8))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@frankyn frankyn frankyn approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@benbenw @frankyn @yoshi-kokoro @athakor
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.