- Notifications
You must be signed in to change notification settings - Fork8
A 3x faster implementation of cat, using splice
License
Apache-2.0, MIT licenses found
Licenses found
mre/fcat
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
fcat
, short forfastcat, is acat
implementation in Rust using Linux'ssplice
syscall.
With that little trick, it'smore than three times as fast as the systemcat
in our benchmarks.
Read theannouncement here.
concerning thesplice
system call. (Seehere andhere.) This can't be fixed unless changes to the kernel get made.
cat myfile | pv -r > /dev/null[1.90GiB/s]
fcat myfile | pv -r > /dev/null[5.90GiB/s]
Note: Only works on Linux.
(But you can send me a pull request for other operating systems.)
cargo install fcat
fcat file1 file2 file3
- Be the fastest cat in town.
- Be a drop-in replacement for (POSIX) cat.
- Provide any additional functionality other than what
cat
provides.
If you're looking for a morebeautiful cat, check outbat.
If you runfcat /dev/zero >> myfile
, it will fail with exit codeEINVAL
because, according to thesplice manpage: "The target file is opened in append mode."
- You probably won't ever need this, but it's a fun little experiment.
Still, I wonder why this is not part of e.g. GNU cat... - What I like the most about the project is the logo.
fcat is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE orhttp://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttp://opensource.org/licenses/MIT)
at your option.
About
A 3x faster implementation of cat, using splice