benchmarks/tinymembench: Add new port

This is a simple memory benchmark program, which tries to measure the
peak bandwidth of sequential memory accesses and the latency of random
memory accesses. Bandwidth is measured by running different assembly
code for the aligned memory blocks and attempting different prefetch
strategies.
This commit is contained in:
Emanuel Haupt 2023-12-21 09:11:19 +01:00
parent 77087bd1ef
commit b2a837790c
9 changed files with 104 additions and 0 deletions

View file

@ -104,6 +104,7 @@
SUBDIR += sysbench
SUBDIR += tcpblast
SUBDIR += thrulay
SUBDIR += tinymembench
SUBDIR += tsung
SUBDIR += ttcp
SUBDIR += typometer

View file

@ -0,0 +1,23 @@
PORTNAME= tinymembench
DISTVERSIONPREFIX= v
DISTVERSION= 0.4
CATEGORIES= benchmarks
MAINTAINER= ehaupt@FreeBSD.org
COMMENT= Simple benchmark for memory throughput and latency
WWW= https://github.com/ssvb/tinymembench
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= gmake
USE_GCC= yes
USE_GITHUB= yes
GH_ACCOUNT= ssvb
PLIST_FILES= bin/tinymembench
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1703098360
SHA256 (ssvb-tinymembench-v0.4_GH0.tar.gz) = e37a2682065b2778f2fa7f22bd59472f5ca2191be48503952ae020b8f023f23d
SIZE (ssvb-tinymembench-v0.4_GH0.tar.gz) = 13564

View file

@ -0,0 +1,40 @@
--- Makefile.orig 2016-03-30 04:42:59 UTC
+++ Makefile
@@ -1,29 +1,27 @@ all: tinymembench
all: tinymembench
-ifdef WINDIR
- CC = gcc
-endif
+CC ?= gcc
tinymembench: main.c util.o util.h asm-opt.h version.h asm-opt.o x86-sse2.o arm-neon.o mips-32.o aarch64-asm.o
- ${CC} -O2 ${CFLAGS} -o tinymembench main.c util.o asm-opt.o x86-sse2.o arm-neon.o mips-32.o aarch64-asm.o -lm
+ ${CC} ${CFLAGS} -o tinymembench main.c util.o asm-opt.o x86-sse2.o arm-neon.o mips-32.o aarch64-asm.o -lm
util.o: util.c util.h
- ${CC} -O2 ${CFLAGS} -c util.c
+ ${CC} ${CFLAGS} -c util.c
asm-opt.o: asm-opt.c asm-opt.h x86-sse2.h arm-neon.h mips-32.h
- ${CC} -O2 ${CFLAGS} -c asm-opt.c
+ ${CC} ${CFLAGS} -c asm-opt.c
x86-sse2.o: x86-sse2.S
- ${CC} -O2 ${CFLAGS} -c x86-sse2.S
+ ${CC} ${CFLAGS} -c x86-sse2.S
arm-neon.o: arm-neon.S
- ${CC} -O2 ${CFLAGS} -c arm-neon.S
+ ${CC} ${CFLAGS} -c arm-neon.S
aarch64-asm.o: aarch64-asm.S
- ${CC} -O2 ${CFLAGS} -c aarch64-asm.S
+ ${CC} ${CFLAGS} -c aarch64-asm.S
mips-32.o: mips-32.S
- ${CC} -O2 ${CFLAGS} -c mips-32.S
+ ${CC} ${CFLAGS} -c mips-32.S
clean:
-rm -f tinymembench

View file

@ -0,0 +1,8 @@
--- aarch64-asm.S.orig 2016-03-30 04:42:59 UTC
+++ aarch64-asm.S
@@ -123,3 +123,5 @@ asm_function aligned_block_copy_ld1st1_aarch64
.endfunc
#endif
+
+.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,8 @@
--- arm-neon.S.orig 2016-03-30 04:42:59 UTC
+++ arm-neon.S
@@ -473,3 +473,5 @@ asm_function aligned_block_copy_vfp
.endfunc
#endif
+
+.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,8 @@
--- mips-32.S.orig 2016-03-30 04:42:59 UTC
+++ mips-32.S
@@ -181,3 +181,5 @@ asm_function aligned_block_copy_pf32_mips32
.endfunc
#endif
+
+.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,8 @@
--- x86-sse2.S.orig 2016-03-30 04:42:59 UTC
+++ x86-sse2.S
@@ -243,3 +243,5 @@ asm_function aligned_block_fill_nt_sse2
/*****************************************************************************/
#endif
+
+.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,5 @@
This is a simple memory benchmark program, which tries to measure the
peak bandwidth of sequential memory accesses and the latency of random
memory accesses. Bandwidth is measured by running different assembly
code for the aligned memory blocks and attempting different prefetch
strategies.