ext4: add benchmarks mimicking creating a containerd rwlayer#366
Open
djs55 wants to merge 1 commit intodiskfs:masterfrom
Open
ext4: add benchmarks mimicking creating a containerd rwlayer#366djs55 wants to merge 1 commit intodiskfs:masterfrom
djs55 wants to merge 1 commit intodiskfs:masterfrom
Conversation
Collaborator
|
Needs a rebase, and lint is failing |
Add benchmarks for ext4.Create on 20 GB sparse images with metadata
checksums — the configuration used by containerd for writable container
layers. Includes a mkfs.ext4 reference benchmark for comparison.
Run all benchmarks (e2fsprogs must be on PATH for the mkfs.ext4 reference):
PATH="/opt/homebrew/opt/e2fsprogs/sbin:$PATH" \
go test -bench BenchmarkCreate20GB -run '^$' -benchmem ./filesystem/ext4/
Run e2fsck validation tests:
PATH="/opt/homebrew/opt/e2fsprogs/sbin:$PATH" \
go test -run TestCreateLazyInitE2fsck -v ./filesystem/ext4/
Results on Apple M3 Max (macOS, APFS):
BenchmarkCreate20GB 484ms 763MB 2.79M allocs
BenchmarkCreate20GBNoJournal 438ms 762MB 2.79M allocs
BenchmarkCreate20GBMkfsExec 11ms 10KB 58 allocs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59d99fe to
c3b17f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first patch is #365 (to fix a journal issue). The second patch is new.
Thinking of nerdbox + containerd on Mac, where the writable layer is an ext4 filesystem created on the host: currently it uses
mkfs.ext4, but it would be interesting if it could usego-diskfsinstead.This PR adds a benchmark, comparing it to
mkfs.ext4:(I added the unit test just to check the outputs are valid, separate from the benchmark itself)
So it's a bit slower (see the ns/op) but I've got some experimental patches which could speed it up. I'll make those as a separate draft PR and describe how I created them, in case you'd like to reproduce (since it was an AI investigation).