Kevin Pulo, MongoDB Labs
Linux IPC benchmarking framework, inspired by detailyang/ipc_benchmark.
make clean
make
-
Manual benchmark run:
$ ./main Usage: ./main <size> <target_runtime_us> <num_mangle> [<method> <method> ...]<size>is the size in bytes of the message/buffer. Will be rounded up to the nearest multiple of 4 bytes.<target_runtime_us>is how long each method should aim to run for. The method will be run for 10 iterations as a warm-up, and the duration of this used to compute how many iterations should be performed to obtain a runtime of (approximately)target_runtime_us.<num_mangle>is the number of "mangle" operations to perform as the workload, each of which is a 32-bit integer increment.<method>is one of the below IPC Method names. If omitted, all compiled-in methods will be run.
Output is to stdout, and also detailed run info is appended to the
./statsfile. -
Automated set of benchmark runs:
$ ./tests-quick-1This script will run each of the methods configured in it, for the configured combinations of
size+target_runtime_us. -
Basic results processing:
$ ./stats-separate <stats-file> [<stats-file> ...]For each given
<stats-file>, create a file<stats-file>.<method>(for each<method>in the original<stats_file>). Each file contains the space-separated columns:size,num_mangle,mb_sec,msgs_sec. -
Improved results processing:
$ ./stats-combined <stats-file> [<stats-file> ...]For each given
<stats-file>, create a file<stats-file>.combined. The file contains tables of tab-separated columns, collecting the MB/s and msgs/s results for all methods, grouped first by eachnum_manglevalue (and then eachsizevalue within that), and then grouped by eachsizevalue (and then eachnum_manglevalue within that). The tab-separated output is also copied to the clipboard (for each pasting into a spreadsheet to create charts), while a space-expanded version is output to stdout.
-
null: No communication, just apply the workload to the buffer. This simulates an in-process function call (passing by reference). -
nullcopy: Likenull, but copy to/from a second buffer before applying the workload. This simulates an in-process function call (passing by value). -
pipe: Useread(2)/write(2)on anonymous unix pipes. -
shm: Shared memory using SysV IPC shm segments. -
mmap: Shared memory usingmmap(2)on a file in/dev/shm(ie.tmpfs). -
mmapanon: Shared memory usingmmap(2)withMMAP_ANONYMOUS. -
pipesplice: An attempt at single-copy page handover using thevmsplice(2)syscall (withSPLICE_F_GIFT) instead ofwrite(2). Gives similar performance topipe, so unlikely to be actually working. -
pipesplice: Similar topipesplice, but attempting to also usesplice(2)syscall (withSPLICE_F_MOVE) instead ofread(2). Also gives similar performance topipe, so unlikely to be actually working. -
pipe1: Likepipe, but unidirectional. Outdated, unmaintained, and likely no longer works properly. -
fifo: Useread(2)/write(2)on named pipes/FIFO special files. Never properly implemented. -
fifo1: Intended to be a unidirectional version offifo, but also never properly implemented.