Fix and optimize Runfiles#fingerprint #18384
Fix and optimize Runfiles#fingerprint #18384fmeum wants to merge 3 commits intobazelbuild:masterfrom
Runfiles#fingerprint #18384Conversation
dfcf2eb to
6103e8a
Compare
The fingerprint did not include the conflict policy and some of the collection's sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets.
6103e8a to
78a896e
Compare
lberki
left a comment
There was a problem hiding this comment.
Thanks! The only real issue I have is with InterruptedException handling; it's easy to get that wrong.
src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
Outdated
Show resolved
Hide resolved
| */ | ||
| public static class GetInitPyFiles implements Runfiles.EmptyFilesSupplier { | ||
| private final Predicate<PathFragment> isPackageInit; | ||
| private final UUID guid; |
There was a problem hiding this comment.
nit: mind adding a comment as to why the UUID is necessary here? It's a little surprising if one doesn't intimately know how Runfiles works.
There was a problem hiding this comment.
I added a comment to the constructor argument. Should I also add it to the field?
There was a problem hiding this comment.
Meh, I won't make you jump through that particular hoop; it's not that big a deal.
src/main/java/com/google/devtools/build/lib/actions/ActionKeyContext.java
Outdated
Show resolved
Hide resolved
lberki
left a comment
There was a problem hiding this comment.
Thanks for this change! Let's merge it.
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
|
@bazel-io fork 6.3.0 |
|
@lberki @fmeum |
|
@keertk Since the other cherry-picks have been reverted/dropped, I don't think it makes sense to include this one. |
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of
NestedSets and instead always flattened the sets.The new
fingerprintmethod onEmptyFilesSuppliermakes it possible to drop the call toRunfiles#getEmptyFilenames, which would still end up flattening the sets.See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80