-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8272297: FileInputStream should override transferTo() for better performance #5097
Conversation
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
Invoking |
Webrevs
|
Without the source change the test fails, but passes with the change in place. |
There is no overlap with #4263. |
#4263 is the input stream returned by Channels.newInputStream where the source may be a FileChannel and the output stream specified to InputStream::transferTo may be connected to a FileChannel. |
} | ||
} | ||
return transferred + super.transferTo(out); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, I think this version is right.
@bplb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 84 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Having followed both #4263 and this PR from the sidelines, may I ask why for #4263 much more rigorous testing is asked but not here? E.g. test for NPE, random-sized files/buffers, random position, return value, comprehensive JMH tests to show performance, etc? I'm all for high quality standards and good test coverage, but why are we seemingly measuring with double standards? |
I don't think your comment is fair. The FIS PR is modest, covering one scenario, it's easy to review. The serious bugs that we pointed out have been addressed and test coverage has been added. The Channels PR is much more ambitious and is trying to cover a matrix of scenarios involving file channel and selectable channels, lots of corner cases and potential issues, and will require a lot of review cycles. None of the scenarios had any test coverage initially. This has been partially addressed but the proposal is still unwieldy, hence the discussion on reducing the scope to something manageable. |
/integrate |
Going to push as commit 8268825.
Your commit was automatically rebased without conflicts. |
Please consider this request to add an override
java.io.FileInputStream.transferTo(OutputStream)
with improved performance if the parameter is aFileOutputStream
.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5097/head:pull/5097
$ git checkout pull/5097
Update a local copy of the PR:
$ git checkout pull/5097
$ git pull https://git.openjdk.java.net/jdk pull/5097/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5097
View PR using the GUI difftool:
$ git pr show -t 5097
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5097.diff