Coder Social home page Coder Social logo

iq-scm / fcat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mre/fcat

0.0 0.0 0.0 453 KB

A 3x faster implementation of cat, using splice

Home Page: https://endler.dev/2018/fastcat

License: Apache License 2.0

Shell 7.31% Rust 77.60% Makefile 4.04% Dockerfile 11.05%

fcat's Introduction

๐Ÿ˜ผ fcat

Github Actions

fastcat logo

fcat, short for fastcat, is a cat implementation in Rust using Linux's splice syscall.
With that little trick, it's more than three times as fast as the system cat in our benchmarks.
Read the announcement here.

โš ๏ธ This project is currently broken on newer Linux versions (5.9+) because of some changes
concerning the splice system call. (See here and here.) This can't be fixed unless changes to the kernel get made.

Performance

cat myfile | pv -r > /dev/null
[1.90GiB/s]
fcat myfile | pv -r > /dev/null
[5.90GiB/s]

Installation

Note: Only works on Linux.
(But you can send me a pull request for other operating systems.)

cargo install fcat

Usage

fcat file1 file2 file3

Project goals

  • Be the fastest cat in town.
  • Be a drop-in replacement for (POSIX) cat.

Non-goals

  • Provide any additional functionality other than what cat provides.
    If you're looking for a more beautiful cat, check out bat.

Known issues

If you run fcat /dev/zero >> myfile, it will fail with exit code EINVAL because, according to the splice manpage: "The target file is opened in append mode."

Trivia

  • 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.

License

fcat is licensed under either of

at your option.

fcat's People

Contributors

mre avatar dependabot-preview[bot] avatar vbrandl avatar dependabot[bot] avatar dzamlo avatar chocolateboy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.