From 03b1356cbbcaa7852a74888b03c222a7b30e9a64 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Sun, 1 Mar 2026 13:15:13 +1100 Subject: feat(bench): Add benchmarking --- bench/Makefile | 34 ++++++++++++++++++++++++++++++++++ bench/dist/bench.o | Bin 0 -> 800 bytes bench/src/format/image/bmp.o | Bin 0 -> 3144 bytes bench/src/format/image/png.o | Bin 0 -> 10944 bytes 4 files changed, 34 insertions(+) create mode 100644 bench/Makefile create mode 100644 bench/dist/bench.o create mode 100644 bench/src/format/image/bmp.o create mode 100644 bench/src/format/image/png.o diff --git a/bench/Makefile b/bench/Makefile new file mode 100644 index 0000000..423b9d3 --- /dev/null +++ b/bench/Makefile @@ -0,0 +1,34 @@ +CC=gcc +CFLAGS=-Wall -Wextra -std=c11 -O2 \ + -I../include \ + -I../include/tinyff \ + -I../include/ext + +OUTDIR=dist +TARGET=$(OUTDIR)/bench +FORMATS ?= image + +COMMON_SRC := bench.c + +FORMAT_SRC := $(foreach fmt,$(FORMATS),\ + $(shell find ../src/format/$(fmt) -name "*.c" 2>/dev/null)) + +SRC := $(COMMON_SRC) $(FORMAT_SRC) + +OBJ := $(patsubst %.c,$(OUTDIR)/%.o,$(SRC)) + +LIB=../dist/libtinyff.a + +all: $(TARGET) + +$(TARGET): $(OBJ) + $(CC) $(CFLAGS) $^ $(LIB) -o $@ + +$(OUTDIR)/%.o: %.c + mkdir -p $(dir $@) + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -rf $(OUTDIR) + +.PHONY: all clean diff --git a/bench/dist/bench.o b/bench/dist/bench.o new file mode 100644 index 0000000..4335b89 Binary files /dev/null and b/bench/dist/bench.o differ diff --git a/bench/src/format/image/bmp.o b/bench/src/format/image/bmp.o new file mode 100644 index 0000000..f403f73 Binary files /dev/null and b/bench/src/format/image/bmp.o differ diff --git a/bench/src/format/image/png.o b/bench/src/format/image/png.o new file mode 100644 index 0000000..095cef8 Binary files /dev/null and b/bench/src/format/image/png.o differ -- cgit v1.2.3