Skip to content

burette: add virtio-fs readdir benchmark test#3451

Open
benhillis wants to merge 4 commits into
microsoft:mainfrom
benhillis:benhillis/burette-virtiofs-readdir
Open

burette: add virtio-fs readdir benchmark test#3451
benhillis wants to merge 4 commits into
microsoft:mainfrom
benhillis:benhillis/burette-virtiofs-readdir

Conversation

@benhillis
Copy link
Copy Markdown
Member

Add a new burette performance test that measures virtio-fs directory listing (readdir) throughput. The test creates a directory populated with 10,000 files and measures:

  • Plain readdir (ls -f): exercises the FUSE READDIR path via the kernel's READDIRPLUS_AUTO fallback. This is the path optimized by virtiofs: remove unnecessary per-entry lookup from plain readdir #3440 (removing per-entry lookup_helper calls).

  • Readdirplus (ls -l): exercises the FUSE READDIRPLUS path with per-entry lookups, serving as a control that should be unaffected by the optimization.

The test uses GNU coreutils from the petritools erofs image (via chroot) to ensure ls -f does not stat entries, and uses date +%s.%N for nanosecond timing precision.

Benchmark results

On ext4 backing store, the optimization in #3440 yields:

Metric Baseline Optimized Delta
Plain readdir (entries/s) 65,669 93,549 +42.5%
Readdirplus (entries/s) 184.58 193.36 ~4.8% (noise)

Add a new burette performance test that measures virtio-fs directory
listing (readdir) throughput. The test creates a directory populated
with 10,000 files and measures:

- Plain readdir (ls -f): exercises the FUSE READDIR path via the
  kernel's READDIRPLUS_AUTO fallback. This is the path optimized by
  PR microsoft#3440 (removing per-entry lookup_helper calls).

- Readdirplus (ls -l): exercises the FUSE READDIRPLUS path with
  per-entry lookups, serving as a control that should be unaffected
  by the optimization.

The test uses GNU coreutils from the petritools erofs image (via
chroot) to ensure ls -f does not stat entries, and uses date +%s.%N
for nanosecond timing precision.

Benchmark results on ext4 backing store show the optimization in
PR microsoft#3440 yields ~42% improvement in plain readdir throughput while
leaving readdirplus unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 11, 2026 16:40
@benhillis benhillis requested a review from a team as a code owner May 11, 2026 16:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new burette warm performance benchmark that measures virtio-fs directory listing throughput in a Linux-direct VM, aiming to quantify improvements from the plain readdir optimization described in #3440.

Changes:

  • Introduces virtio_fs_readdir warm perf test that populates a host-backed virtio-fs directory with many files and measures guest enumeration time for ls -f (plain readdir) and ls -l (readdirplus-like workload).
  • Wires the new test into the burette CLI (--test virtio-fs-readdir) and adds --readdir-file-count for parameterization.
  • Ensures packaging includes the new test’s artifact requirements.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
petri/burette/src/tests/virtio_fs_readdir.rs Adds new virtio-fs readdir benchmark implementation and metric reporting.
petri/burette/src/tests/mod.rs Exposes the new test module.
petri/burette/src/main.rs Registers the new test/CLI option and adds an argument to control file count; includes artifacts in packaging.

Comment thread petri/burette/src/tests/virtio_fs_readdir.rs Outdated
Comment thread petri/burette/src/tests/virtio_fs_readdir.rs Outdated
Comment thread petri/burette/src/tests/virtio_fs_readdir.rs Outdated
Comment thread petri/burette/src/main.rs
- Fix metric names in module docs to match actual emitted names
- Add unmeasured priming pass so plain readdir timing excludes
  the initial READDIRPLUS iteration
- Improve mount error message with CONFIG_VIRTIO_FS hint
- Document virtio-fs-readdir test in Guide/src/dev_guide/tests/perf.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Guide label May 11, 2026
Move the readdir benchmark test from its own file into virtio_fs.rs
to match the existing burette pattern where each component is a
single .rs file. Both tests share the same register_artifacts
function since they need identical artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 11, 2026 18:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread petri/burette/src/tests/virtio_fs.rs Outdated
Comment thread petri/burette/src/tests/virtio_fs.rs
Comment thread Guide/src/dev_guide/tests/perf.md Outdated
- Redirect priming pass ls -f to /dev/null to avoid large stdout
- Account for . and .. entries in entries/s calculation
- Wrap long guide bullet lines to ~80 chars

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants