Skip to content

Add benchmark for ls_cmd using a ext4 test image of around 1000 files#1622

Open
yunzheng wants to merge 5 commits intomainfrom
benchmark-ls-cmd
Open

Add benchmark for ls_cmd using a ext4 test image of around 1000 files#1622
yunzheng wants to merge 5 commits intomainfrom
benchmark-ls-cmd

Conversation

@yunzheng
Copy link
Member

This PR adds a benchmark test for the ls_cmd in target-shell and a new test fixture providing an ext4 image with around 1000 files for doing the directory listing.

The benchmark is in preparation of implementing #1577 and some other related issues, which will contain some refactoring regarding efficiency.

The test image is derived from debian-live-13.3.0-amd64-standard.iso and only the /bin dir and some files from /etc are copied over. The file contents in /bin are also all sparse (NULL bytes) so the image compresses well. The test data mainly focuses on what is useful for directory listings, such as filenames, permissions, owner and group.

The compressed test image itself is only 100kb.

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.06%. Comparing base (3592dbe) to head (1411df3).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1622      +/-   ##
==========================================
+ Coverage   81.00%   81.06%   +0.05%     
==========================================
  Files         401      402       +1     
  Lines       35176    35244      +68     
==========================================
+ Hits        28495    28571      +76     
+ Misses       6681     6673       -8     
Flag Coverage Δ
unittests 81.06% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 16, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks
🆕 2 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_benchmark_ls_bin[] N/A 425.8 ms N/A
🆕 test_benchmark_ls_bin[-l] N/A 4 s N/A

Comparing benchmark-ls-cmd (1411df3) with main (6117402)

Open in CodSpeed

@yunzheng yunzheng force-pushed the benchmark-ls-cmd branch 3 times, most recently from 8ab4b02 to f939c33 Compare March 17, 2026 19:39
@yunzheng yunzheng requested a review from Schamper March 17, 2026 19:42
Comment on lines +630 to +631
The /bin files are all sparse (filled with zeros).
The files in /etc do contain data.
Copy link
Member

Choose a reason for hiding this comment

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

Can you just shortly describe how you created this test image? At some point in the future we might want to put it into a (reproducible) script but for now having a description of the process would be nice already.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants