/fcat

A faster "cat"

Primary LanguageCMIT LicenseMIT

fcat

Extending the idea of fastcat, this is an attempt to implement cat with higher throughput by using splice(2) to avoid copying between kernel space and user space.

Build

$ make

Installation

$ make install

Usage

Just like cat:

$ fcat *.c

Benchmark

Tested with 10GB file generated with dd.

$ dd if=/dev/random of=10gb.txt count=1024 bs=10485760

The pipe speed can be checked with pv.

GNU cat

$ cat 10gb.txt | pv -r > /dev/null
[ 500MiB/s]

fcat

$ fcat 10gb.txt | pv -r > /dev/null
[ 780MiB/s]

Interestingly, the speed of fcat fluctuates more than cat. And sometimes it is slower than cat.

License

MIT