Simplify blake3 hasher and improve performance#19041
Closed
tylerwilliams wants to merge 1 commit intobazelbuild:masterfrom
Closed
Simplify blake3 hasher and improve performance#19041tylerwilliams wants to merge 1 commit intobazelbuild:masterfrom
tylerwilliams wants to merge 1 commit intobazelbuild:masterfrom
Conversation
fb651a5 to
3c81c52
Compare
Contributor
coeuvre
requested changes
Jul 25, 2023
Member
coeuvre
left a comment
There was a problem hiding this comment.
Thanks! I like this change not only because it improves the performance but also makes the code easier to read/maintain.
| flush(); | ||
| } | ||
| buffer.put(b); | ||
| engineUpdate(new byte[] {b}, 0, 1); |
Member
There was a problem hiding this comment.
I don't know whether creating a temporary array here will impact performance (and I have no idea when this method will be called), but can we avoid doing that? For example, we could have a 1 sized byte array buffer created ahead of time.
3c81c52 to
4ee7857
Compare
coeuvre
approved these changes
Jul 26, 2023
Member
|
The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improve BLAKE3 performance by reducing copies.
Rather than buffering bytes, it's faster to just update the blake3 hasher as bytes are hashed.
Performance with buffering:
Performance without buffering (after this CL):