Code Monkey home page Code Monkey logo

pipes-speed-test's Introduction

Some experiments concerning the performance of Linux pipes. Please head to the blog post to understand what this code is about.

Building and running

% make
% ./write | ./read
4.5GiB/s, 256KiB buffer, 40960 iterations (10GiB piped)

./read reads 10GiB (by default). Use --csv for machine-readable output with this schema:

gigabytes_per_second,bytes_to_pipe,buf_size,pipe_size,busy_loop,poll,huge_page,check_huge_page,write_with_vmsplice,read_with_splice,gift,lock_memory,dont_touch_pages,same_buffer

Where the first four are numbers and the rest are booleans. All the fields apart from gigabytes_per_seconds (which is the main output of the program) are configurable on the command line. Check out parse_options in common.hpp.

measure.py can be ran to automatically produce the data shown in the graph at the top of the blog post. It requires taskset, and various python libraries. If you have nix:

% nix-shell
% python3 measure.py

Additionally, get-user-pages.cpp contains a small benchmark using /sys/kernel/debug/gup_test. To run it, you need to compile your kernel with CONFIG_GUP_TEST y. Also, the file and flag were recently renamed, prior to kernel version 5.17 they were called gup_benchmark and CONFIG_GUP_BENCHMARK, respectively.

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.