Open
Description
For a standard Linux kernel source, nydus-image create
now takes 8s by taking the default configuration.
There are 65119 files in this kernel source, and
# 1st run
$time ./target-fusedev/release/nydus-image create -B liubo/src.bootstrap -D liubo liubo/kernel_src
[2022-05-19 02:08:28.078232 +08:00] INFO [rafs/src/metadata/md_v5.rs:28] rafs superblock features: COMPRESS_LZ4_BLOCK | DIGESTER_BLAKE3 | EXPLICIT_UID_GID
[2022-05-19 02:08:28.340749 +08:00] INFO [src/bin/nydus-image/main.rs:622] build successfully: BuildOutput { artifacts: [BuildOutputArtifact { bootstrap_name: "", blobs: [] }], blobs: ["95922bb8a3ed6bd320f1c8376c26197ef2107cb8ce6d9094a3a17da0dbe44810"], last_blob_size: Some(301576727), last_bootstrap_name: "" }
real 0m8.099s
user 0m6.667s
sys 0m1.345s
# 2nd run
real 0m7.999s
user 0m6.682s
sys 0m1.315s
# 3rd run
real 0m7.970s
user 0m6.702s
sys 0m1.267s
The above process involves
- iterating directories recursively
- reading, compressing and writing data to the final blob
- writing bootstrap
Looks like the bottleneck is not about IO since I've tried running the whole process in temps, which only gave 5% improvement.
IMO, there is some space that we can make it faster, the ideal goal is within 1s.