• Stars
    star
    676
  • Rank 66,347 (Top 2 %)
  • Language
    C
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐎 Benchmarks for Inter-Process-Communication Techniques

IPC-Bench

GitHub license

Implementations and benchmarks for various inter-process-communication (IPC) methods on Linux and OS X.

Spectrum

The following IPC methods are implemented. To measure their sequential throughput we send a single message forth and back (i.e., ping pong) between two processes.

Method 100 Byte Messages 1 Kilo Byte Messages
Unix Signals --broken-- --broken--
ZeroMQ (TCP) 24,901 msg/s 22,679 msg/s
Internet sockets (TCP) 70,221 msg/s 67,901 msg/s
Domain sockets 130,372 msg/s 127,582 msg/s
Pipes 162,441 msg/s 155,404 msg/s
Message Queues 232,253 msg/s 213,796 msg/s
FIFOs (named pipes) 265,823 msg/s 254,880 msg/s
Shared Memory 4,702,557 msg/s 1,659,291 msg/s
Memory-Mapped Files 5,338,860 msg/s 1,701,759 msg/s
Benchmarked on Intel(R) Core(TM) i5-4590S CPU @ 3.00GHz running Ubuntu 20.04.1 LTS.

NOTE: The code is rather old and there might be sub-optimal configurations! We are happy to update the configuration with concrete suggestions (see contributions below). In particular, zeromq is a great library and should probably be performing better, especially because we are only using the TCP implementation. There is one dedicated for IPC (-> TODO). In addition, there is little technical reason for shared memory to perform differently than memory-mapped files (could be due to a lack of warmup). Non-the-less, hopefully, this benchmark can serve as a solid starting point by providing ball-park numbers and a reference implementation.

For a detailed evaluation of inter-node communication, see our L5 library.

Usage

Some required packages on Ubuntu:

sudo apt-get install pkg-config, libzmqpp-dev

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
=====================================

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.

Contributions

Contributions are welcome, as long as they fit within the goal of this benchmark: sequential single-node communication.

Just open an issues or send a pull request.

License

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

Authors

Peter Goldsborough + cat ❤️

Some maintenance by Alexander van Renen

More Repositories

1

clang-expand

🐉 A clang tool for happy refactoring without source-code gymnastics
C++
247
star
2

lru-cache

💫 A feature complete LRU cache implementation in C++
C++
234
star
3

ig

🎆 Include graph visualization for C++
Python
198
star
4

Writer-Tutorial

PyQt text editor tutorial repository
Python
185
star
5

vector

A pure C vector implementation
C
138
star
6

latexpp

A C++ LaTeX generator
C++
137
star
7

microservice-rs

Tutorial codebase for writing a microservice in Rust
Rust
129
star
8

markdownpp

A C++ Markdown solution.
CSS
83
star
9

tssx

Transparently replace domain sockets with a fast shared memory channel
C
68
star
10

k-means

Code accompanying my blog post on k-means in Python, C++ and CUDA
Cuda
58
star
11

hashtable

A pure C hashtable implementation.
C
45
star
12

Writer

PyQt Text Editor
Python
41
star
13

AVR-DHT11

🪲 AVR code to interface with the DHT11 temperature and relative humidity sensors
C
27
star
14

psag.cc

A URL shortener for my blog, written in Rust
Rust
24
star
15

bitset

A pure C Bitset implementation.
C
17
star
16

pytorch-cpp-extension

PyTorch C++ Extension Example
Python
15
star
17

generate-shapes

⬛ 🔴 Generate shapes for object detection algorithms
Python
14
star
18

bloom-cpp

🔍 A header-only bloom filter implementation in C++14.
C++
13
star
19

cytogan

Repository for my research on generative modelling of cell images
Python
13
star
20

progress

A pluggable command line progress bar
Shell
12
star
21

algs4

Notes and Implementations for Princeton Algs4 course.
Java
12
star
22

dispy

A tiny Python bytecode disassembler
Python
10
star
23

router-trie

A Hash Array Mapped Trie for fast Routing Table lookups.
C
10
star
24

GoogleCloudVisionOCRExample

Using the Google Cloud Vision API for OCR in Swift
Swift
9
star
25

Mavrchester

Atmel AVR C code for Manchester Encoding.
C
8
star
26

atom-clang-expand

🐉 A clang tool for happy refactoring without source-code gymnastics (atom package)
JavaScript
6
star
27

your_app

Tutorial repository for "Creating and Distributing a Python Project".
Python
6
star
28

li

A license fetcher
Python
6
star
29

data-structures

Data structure implementations.
C++
5
star
30

algorithms

Algorithm implementations.
C++
5
star
31

Anthem

The to-be go-to open-source, community-driven synthesizer
C++
5
star
32

Parsley

C++ XML Parser
C++
4
star
33

real-fake

Tiny app for GAN image "turing tests"
HTML
3
star
34

lnk

Command-line URL shortening client.
Python
3
star
35

ecstasy

A command-line-tool beautifier
Python
2
star
36

euler

Project Euler Solutions.
Python
1
star
37

enum-class.js

Strongly typed enums in JavaScript
JavaScript
1
star