fcp
fcp
is a significantly faster alternative to the classic Unix cp(1)
command.
fcp
aims to handle the most common use-cases for cp
with much higher performance.
fcp
does not aim to completely replace cp
with its myriad options.
Installation
Pre-built binaries
Pre-built binaries for some systems can be found under this repository's releases.
cargo
Via fcp
can be installed using cargo
by running the following:
cargo install fcp
Usage
Usage information can be found by running fcp --help
, and has been reproduced below:
fcp
USAGE:
fcp SOURCE DESTINATION_FILE
Copy SOURCE to DESTINATION_FILE, overwriting DESTINATION_FILE if it exists
fcp SOURCE ... DESTINATION_DIRECTORY
Copy each SOURCE into DESTINATION_DIRECTORY
Benchmarks
fcp
doesn't just claim to be faster than cp
, it is faster than cp
. As different operating systems display different performance characteristics, the same benchmarks were run on both macOS and Linux.
macOS
The following benchmarks were run on a 2018 MacBook Pro2 (2.9 GHz 6-Core Intel Core i9, 16 GiB RAM, SSD)
Large Files
The following shows the result of a benchmark which copies a directory containing 13 different 512 MB files using cp
and fcp
, with fcp
being approximately 822x faster on average (note the units of the x-axis for each plot)3:
Linux Kernel Source
The following shows the result of a benchmark which copies the source tree of the Linux kernel using cp
and fcp
, with fcp
being approximately 6x faster on average:
Linux
The following benchmarks were run on a bare-metal AWS EC2 instance (a1.metal, 16 CPUs, 32 GiB RAM, SSD)
Linux Kernel Source
The following shows the result of a benchmark which copies the source tree of the Linux kernel using cp
and fcp
, with fcp
being approximately 10x faster on average:
Large Files
The following shows the result of a benchmark which copies a directory containing 13 different 512 MB files using cp
and fcp
, with fcp
being approximately 1.4x faster on average:
[1] See the benchmarks.
[2] While in general you should avoid benchmarking on laptops, fcp
is a developer tool and many developers work primarily on laptops. Also unlike with Linux where you can rent by the second, the minimum tenancy for AWS EC2 macOS instances is 24 hours, and these benchmarks took less than an hour.
[3] The massive difference in performance in this case is due to fcp
using fclonefileat
and fcopyfile
under the hood.