Skip to content

[10.0.0] Avoid a stat when computing digests during file system traversal (#32928) - #32950

Open
bazel-io wants to merge 1 commit into
bazelbuild:release-10.0.0from
bazel-io:cp32928-10.0.0-213833
Open

bazel-io wants to merge 1 commit into
bazelbuild:release-10.0.0from
bazel-io:cp32928-10.0.0-213833

Conversation

@bazel-io

Copy link
Copy Markdown
Member

Description

RecursiveFilesystemTraversalFunction already knows the size and FileContentsProxy of files without a digest, which are sufficient for a lookup in the file digest cache. Passing the proxy to FileArtifactValue.createForNormalFileUsingPath avoids another stat of the file. The proxy is not retained in the resulting metadata, as before.

Motivation

In a build of //src:bazel-dev with a populated disk cache on macOS, this avoids about 12,000 of 323,000 stats.

Work towards #30422

Build API Changes

No

Release Notes

RELNOTES: None

Closes #32928

COPYBARA_INTEGRATE_REVIEW=#32928 from fmeum:traversal-digest-without-stat 67da463
PiperOrigin-RevId: 1030159049
Change-Id: I77d83e2178bc08ddd3f32bae15fbcf944f7b80cc

Commit 224c0bf

…elbuild#32928)

### Description

`RecursiveFilesystemTraversalFunction` already knows the size and `FileContentsProxy` of files without a digest, which are sufficient for a lookup in the file digest cache. Passing the proxy to `FileArtifactValue.createForNormalFileUsingPath` avoids another stat of the file. The proxy is not retained in the resulting metadata, as before.

### Motivation

In a build of `//src:bazel-dev` with a populated disk cache on macOS, this avoids about 12,000 of 323,000 stats.

Work towards bazelbuild#30422

### Build API Changes

No

### Release Notes

RELNOTES: None

Closes bazelbuild#32928

COPYBARA_INTEGRATE_REVIEW=bazelbuild#32928 from fmeum:traversal-digest-without-stat 67da463
PiperOrigin-RevId: 1030159049
Change-Id: I77d83e2178bc08ddd3f32bae15fbcf944f7b80cc
@bazel-io bazel-io added team-Performance Issues for Performance teams team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer labels Nov 25, 2026
@bazel-io
bazel-io requested a review from tjgq November 25, 2026 21:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Core Skyframe, bazel query, BEP, options parsing, bazelrc team-Performance Issues for Performance teams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants