Giter Site home page Giter Site logo

ipc-bench's Introduction

IPC-Bench

GitHub license

This repository holds sample implementations and benchmarks for various inter-process-communication (IPC) methods on Linux and OS X.

Spectrum

Currently, the following IPC methods are implemented and ready to be benchmarked:

  • Internet sockets
  • Domain sockets
  • Pipes
  • FIFOs (named pipes)
  • Shared Memory
  • Memory-Mapped Files
  • Message Queues
  • ZeroMQ
  • Unix Signals

Our benchmarks measure the latency of sending a single message between two processes (see below).

Usage

You can build the project and all necessary executables using CMake. The following commands (executed from the root folder) should do the trick:

mkdir build
cd build
cmake ..
make

This will generate a build/source folder, holding further directories for each IPC type. Simply execute the program named after the folder, e.g. build/source/shm/shm. Where applicable, this will start a new server and client process, run benchmarks and print results to stdout. For example, running build/source/shm/shm outputs:

============ RESULTS ================
Message size:       4096
Message count:      1000
Total duration:     1.945      	ms
Average duration:   1.418      	us
Minimum duration:   0.000      	us
Maximum duration:   25.000     	us
Standard deviation: 1.282      	us
Message rate:       514138     	msg/s
=====================================

The benchmarks measure the latency of sending a single message from the client to the server and back -- i.e. one ping pong message. To control the number of messages sent and the size of each message, each master executable (which stars the server and client) takes two optional command-line arguments:

  • -c <count>: How many messages to send between the server and client. Defaults to 1000.
  • -s <size>: The size of individual messages. Defaults to 1000.

For example, you can measure the latency of sending 100 bytes a million times via domain sockets with the following command:

$ ./domain -c 1000000 -s 100

We also provide a shell script under results/ that runs all methods with various configurations and stores the results. Some tests may have issues due to system limits, so you may want to re-run the script or run some tests manually.

This project is released under the MIT License. For more information, see the LICENSE file.

Authors

Peter Goldsborough + cat ❤️

ipc-bench's People

Contributors

goldsborough avatar alexandervanrenen avatar

Watchers

James Cloos avatar Gaurav Tayal 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.