We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
org.assertj.core.internal.BinaryDiff could be much faster
Test case reproducing the bug
Path expected = ... Path actual = ... assertThat(actual).hasSameBinaryContentAs(expected);
Solution
Change implementation as follows:
public BinaryDiffResult diff(Path actual, byte[] expected) throws IOException { try(InputStream actualStream = new BufferedInputStream(Files.newInputStream(actual))) { return diff(actualStream, expected); } }
(add BufferedInputStream)
Resulting speedup for 2,5MB: from 8 sec down to 0.2 sec.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @matthiaskraaz, do you want to contribute the improvement ?
Sorry, something went wrong.
You mean, making a PR? I'll try.
Speed up for BinaryDiff used by hasSameBinaryContentAs for example. F…
5768f1d
…ixes assertj#3193.
1b1c3a1
Successfully merging a pull request may close this issue.
org.assertj.core.internal.BinaryDiff could be much faster
Test case reproducing the bug
Solution
Change implementation as follows:
(add BufferedInputStream)
Resulting speedup for 2,5MB: from 8 sec down to 0.2 sec.
The text was updated successfully, but these errors were encountered: