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.
$ make
$ make install
Just like cat
:
$ fcat *.c
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
.