DigestUtils: avoid throwing on invalid digest function name#20574
DigestUtils: avoid throwing on invalid digest function name#20574christianscott wants to merge 2 commits intobazelbuild:masterfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
tjgq
left a comment
There was a problem hiding this comment.
Ouch, 11% is pretty bad! Great find.
| } | ||
|
|
||
| private static final ImmutableSet<String> DIGEST_FUNCTION_NAMES = | ||
| Arrays.stream(DigestFunction.Value.values()).map(v -> v.name()).collect(toImmutableSet()); |
There was a problem hiding this comment.
btw – I could not find a java style guide for the bazel source code, so I assume you use 4 space continuations based on other parts of the codebase
There was a problem hiding this comment.
What helped me for contributions: The style guide is https://google.github.io/styleguide/javaguide.html and you can use https://github.com/google/google-java-format and its IDE plugins for formatting.
There was a problem hiding this comment.
Oh of course it's the google Java style guide. Thanks @fmeum!
|
@tjgq can I assume those CI failures are flakes? |
|
@bazel-io flag |
|
@bazel-io fork 7.1.0 |
9% of samples in a profile of one of our builds were inside the `fillInStackTrace()` method. Collecting the valid names into a hashset avoids needing to construct errors every time an invalid digest function name is passed into this function. Tested with Bazel 6.4.0. Our codebase is not yet compatible with Bazel 7. I have not investigated why this function was receiving so many invalid names. Before:  After:  My understanding is that this will not speed up builds directly, but it will allow BEP events to be processed more quickly. Closes bazelbuild#20574. PiperOrigin-RevId: 592094151 Change-Id: Ie23241c9ec40e59ba2aac1fc83e4830340260f45
…20650) 9% of samples in a profile of one of our builds were inside the `fillInStackTrace()` method. Collecting the valid names into a hashset avoids needing to construct errors every time an invalid digest function name is passed into this function. Tested with Bazel 6.4.0. Our codebase is not yet compatible with Bazel 7. I have not investigated why this function was receiving so many invalid names. Before:  After:  My understanding is that this will not speed up builds directly, but it will allow BEP events to be processed more quickly. Closes #20574. Commit cb08d62 PiperOrigin-RevId: 592094151 Change-Id: Ie23241c9ec40e59ba2aac1fc83e4830340260f45 Co-authored-by: Christian Scott <[email protected]> Co-authored-by: Ian (Hee) Cha <[email protected]> Co-authored-by: Yun Peng <[email protected]>
|
The changes in this PR have been included in Bazel 7.1.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. |
9% of samples in a profile of one of our builds were inside the
fillInStackTrace()method. Collecting the valid names into a hashset avoids needing to construct errors every time an invalid digest function name is passed into this function.Tested with Bazel 6.4.0. Our codebase is not yet compatible with Bazel 7.
I have not investigated why this function was receiving so many invalid names.
Before:
After:
My understanding is that this will not speed up builds directly, but it will allow BEP events to be processed more quickly.