Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Files can have the same mtime (especially when using `SOURCE_DATE_EPOCH`). Cache the time string of the last mtime. Benchmark results on a Raspberry Pi Zero 2W running Ubuntu 24.04 (noble) arm64: ``` $ sudo 3cpio -x /boot/initrd.img -C /var/tmp/initrd $ ( cd /var/tmp/initrd && find . | LC_ALL=C sort | sudo cpio --reproducible --quiet -o -H newc ) > initrd.img $ hyperfine -N --warmup 3 --runs 100 "target/release/3cpio -tv initrd.img" "3cpio-0.3.0+9 -tv initrd.img" Benchmark 1: target/release/3cpio -tv initrd.img Time (mean ± σ): 108.8 ms ± 1.1 ms [User: 46.3 ms, System: 61.3 ms] Range (min … max): 107.1 ms … 111.5 ms 100 runs Benchmark 2: 3cpio-0.3.0+9 -tv initrd.img Time (mean ± σ): 113.2 ms ± 1.0 ms [User: 51.2 ms, System: 60.8 ms] Range (min … max): 111.4 ms … 115.7 ms 100 runs Summary target/release/3cpio -tv initrd.img ran 1.04 ± 0.01 times faster than 3cpio-0.3.0+9 -tv initrd.img ``` Signed-off-by: Benjamin Drung <bdrung@posteo.de>
- Loading branch information