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

Add value for BLAKE3 hash function #248

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

tylerwilliams
Copy link
Contributor

@tylerwilliams tylerwilliams commented Mar 15, 2023

Add BLAKE3 hash function.

@tylerwilliams tylerwilliams changed the title Add value for BLAKE3 hash function: Add value for BLAKE3 hash function Mar 15, 2023
@tylerwilliams
Copy link
Contributor Author

@EricBurnett mind taking a look at this? Thank you!

@EricBurnett
Copy link
Collaborator

LGTM!

@EricBurnett EricBurnett merged commit 8f539af into bazelbuild:main Mar 15, 2023
@EdSchouten
Copy link
Collaborator

EdSchouten commented Mar 15, 2023

@tylerwilliams I was wondering, what's the reason you folks are pursuing using BLAKE3 and not the recently added SHA256TREE digest function (#235)? Sure, at its peak BLAKE3 is faster than SHA256TREE, but the difference isn't that big in the grand scheme of things, right? SHA256TREE has some added advantages:

  • Performance is still adequate on other CPU architectures that provide SHA-256 CPU extensions. For example, BLAKE3 only has 1/10th the throughput of SHA-256 and SHA256TREE on ARM64. BLAKE3 is very strongly opinionated towards x86-64.
  • SHA256TREE is built with chunking in mind, allowing you to decompose large CAS objects into smaller ones. BLAKE3 makes this hard, because of their use of Chunk Counters. In Add support for chunking of blobs, using SHA256TREE #233 I'm working towards extending REv2 to provide facilities for that.

I mean, I'm fine with adding support for BLAKE3, but I'm merely interested in seeing whether we can prevent Balkanization in this area.

@tylerwilliams
Copy link
Contributor Author

@EdSchouten -- Definitely agree re balkanization and I'm very excited to see SHA256TREE land for chunking support. We will likely support this too when it lands in Bazel :)

That said, BLAKE3 is incredibly fast and this is useful when hashing large files, which we do a lot of (docker images, snapshots, large binaries, etc) on CPUs with AVX* support. I don't think it's a bad thing to support this hash in the protocol, or in Bazel, so that these kinds of blobs can be hashed quickly today.

sluongng added a commit to sluongng/remote-apis that referenced this pull request Jun 9, 2023
This is a follow up to bazelbuild#248 to ensure the git hook is running correctly.
@sluongng sluongng mentioned this pull request Jun 9, 2023
bergsieker pushed a commit that referenced this pull request Jun 9, 2023
This is a follow up to #248 to ensure the git hook is running correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants