1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

benchmarks/ipc-bench: Add new port

Benchmarks for various inter-process-communication (IPC) methods.

Sponsored by:	Netflix
This commit is contained in:
Olivier Cochard 2024-03-08 23:49:25 +01:00
parent 9646f5d279
commit 9b1521f733
7 changed files with 125 additions and 0 deletions

View File

@ -35,6 +35,7 @@
SUBDIR += iorate
SUBDIR += iozone
SUBDIR += iozone21
SUBDIR += ipc-bench
SUBDIR += iperf
SUBDIR += iperf3
SUBDIR += kdiskmark

View File

@ -0,0 +1,39 @@
PORTNAME= ipc-bench
DISTVERSION= 1.0
CATEGORIES= benchmarks
MAINTAINER= olivier@FreeBSD.org
COMMENT= Benchmarks for various inter-process-communication (IPC)
WWW= https://github.com/intel/uintr-ipc-bench
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cmake:noninja pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= goldsborough
GH_PROJECT= ipc-bench
GH_TAGNAME= 589146a
BINARIES= domain fifo mmap mq shm signal tcp
OPTIONS_DEFINE= ZMQ
OPTIONS_SUB= yes
ZMQ_DESC= Enable ZeroMQ benches via libzmq${ZMQ_VERSION}
ZMQ_LIB_DEPENDS= libzmq.so:net/libzmq${ZMQ_VERSION}
ZMQ_VERSION?= 4
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MZMQ}
BINARIES+= zeromq
.endif
do-install:
${INSTALL_PROGRAM} ${WRKDIR}/.build/source/pipe/pipe ${STAGEDIR}${PREFIX}/bin
.for f in ${BINARIES}
${INSTALL_PROGRAM} ${WRKDIR}/.build/source/${f}/${f} ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKDIR}/.build/source/${f}/${f}-client ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKDIR}/.build/source/${f}/${f}-server ${STAGEDIR}${PREFIX}/bin
.endfor
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1709854860
SHA256 (goldsborough-ipc-bench-1.0-589146a_GH0.tar.gz) = 734b25b219c35b4818693501b399f66b1739c31b395ced7f7050ffbc78576762
SIZE (goldsborough-ipc-bench-1.0-589146a_GH0.tar.gz) = 347091

View File

@ -0,0 +1,10 @@
--- source/CMakeLists.txt.orig 2024-03-08 21:54:22 UTC
+++ source/CMakeLists.txt
@@ -39,7 +39,6 @@ add_subdirectory(signal)
add_subdirectory(domain)
add_subdirectory(mq)
add_subdirectory(signal)
-add_subdirectory(shm-sync)
if (NOT APPLE)
add_subdirectory(eventfd)

View File

@ -0,0 +1,44 @@
--- source/common/process.c.orig 2022-04-28 15:09:32 UTC
+++ source/common/process.c
@@ -55,7 +55,7 @@ pid_t start_process(char *argv[]) {
// second is an array of arguments, where the
// command path has to be included as well
// (that's why argv[0] first)
- if (execv(argv[0], argv) == -1) {
+ if (execvp(argv[0], argv) == -1) {
throw("Error opening child process");
}
}
@@ -83,24 +83,18 @@ void start_children(char *prefix, int argc, char *argv
char server_name[100];
char client_name[100];
- char *build_path = find_build_path();
-
// clang-format off
sprintf(
server_name,
- "%s/%s/%s-%s",
- build_path,
+ "%s-%s",
prefix,
- prefix,
"server"
);
sprintf(
client_name,
- "%s/%s/%s-%s",
- build_path,
+ "%s-%s",
prefix,
- prefix,
"client"
);
// clang-format on
@@ -111,5 +105,4 @@ void start_children(char *prefix, int argc, char *argv
waitpid(c1_id, NULL, WUNTRACED);
waitpid(c2_id, NULL, WUNTRACED);
- free(build_path);
}

View File

@ -0,0 +1,3 @@
Benchmarks for various inter-process-communication (IPC) methods:
ZeroMQ, TCP socket (tcp), domain socket (domain), named pipes (fifo), signal,
memory mapped file (mmap), message queues (mq), pipe, shared memory (shm).

View File

@ -0,0 +1,25 @@
bin/domain
bin/domain-client
bin/domain-server
bin/fifo
bin/fifo-client
bin/fifo-server
bin/mmap
bin/mmap-client
bin/mmap-server
bin/mq
bin/mq-client
bin/mq-server
bin/pipe
bin/shm
bin/shm-client
bin/shm-server
bin/signal
bin/signal-client
bin/signal-server
bin/tcp
bin/tcp-client
bin/tcp-server
%%ZMQ%%bin/zeromq
%%ZMQ%%bin/zeromq-client
%%ZMQ%%bin/zeromq-server