#tar-archive #tar #archive

app fastar

Fast tar archive creation for HDDs

6 releases

0.2.0 Dec 18, 2021
0.1.5 Mar 18, 2021
0.1.4 Jul 1, 2017
0.1.3 Jun 20, 2017
0.1.1 May 26, 2017

#1408 in Filesystem

24 downloads per month

GPL-3.0 license

20KB
134 lines

Version

fastar

A faster equivalent of tar -cT <(find . -type f), optimized for tarring many small files stored on HDDs.

Optimizations compared to gnu tar:

  • directory traversal based on physical disk layout. see platter-walk crate
  • readaheads across multiple files at once to keep the drive's command queue filled. see reapfrog crate
  • drops disk caches for files once they are read to prevent disk buffer thrashing.

Limitations compared to gnu tar:

  • arguments must be directories
  • only archives regular files, not symlinks or empty directories
  • xattrs are not included
  • sparse files are zero-filled

Building

  • indirect dependencies: libz, liblzo headers
  • cargo build --release

Benchmarks

# ffcnt . -s
files: 6680901
bytes: 245271028476

# echo 3 > /proc/sys/vm/drop_caches ; tar -c . | pv -at > /dev/null
^C0:02:45 [ 2.4MiB/s]

# echo 3 > /proc/sys/vm/drop_caches ; tar -cT <(ffcnt --ls --type f --leaf-order content .) | pv -at > /dev/null
^C0:02:50 [4.11MiB/s]

# echo 3 > /proc/sys/vm/drop_caches ; fastar . | pv -at > /dev/null
^C0:02:51 [9.28MiB/s]

Dependencies

~7–16MB
~243K SLoC