Skip to content

Avoid a stat when computing digests during file system traversal - #32928

Closed
fmeum wants to merge 1 commit into
bazelbuild:masterfrom
fmeum:traversal-digest-without-stat
Closed

fmeum wants to merge 1 commit into
bazelbuild:masterfrom
fmeum:traversal-digest-without-stat

Conversation

@fmeum

@fmeum fmeum commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

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

RecursiveFilesystemTraversalFunction already knows the size and contents
proxy of files without a digest, which are sufficient for a lookup in the
file digest cache. The proxy is not retained in the resulting metadata, as
before.

Work towards bazelbuild#30422
@fmeum
fmeum marked this pull request as ready for review November 24, 2026 19:42
@fmeum
fmeum requested a review from tjgq November 24, 2026 19:42
@github-actions github-actions Bot 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 24, 2026
@tjgq tjgq added copybara:import Trigger copybara to import the PR and removed awaiting-review PR is awaiting review from an assigned reviewer labels Nov 24, 2026
@fmeum

fmeum commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@bazel-io fork 10.0.0

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

Labels

copybara:import Trigger copybara to import the PR 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