From 77aa9a3259ddfd6c64534d63424d5b0fa3010900 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Fri, 22 May 2026 09:43:59 +1000 Subject: refactor: move benches to include directory --- bench/README.md | 9 ------- bench/bench.h | 57 -------------------------------------------- bench/src/format/image/png.c | 6 ----- 3 files changed, 72 deletions(-) delete mode 100644 bench/README.md delete mode 100644 bench/bench.h delete mode 100644 bench/src/format/image/png.c (limited to 'bench') diff --git a/bench/README.md b/bench/README.md deleted file mode 100644 index 4016024..0000000 --- a/bench/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# tinyff benching util - -This folder contains benchmarks for every format. It also contains an API which is used to make custom benches. - -## Structure - -`format/`: Contains benchmark tests for formats -`test/`: Contains tests for common formats. These are example programs. -`bench.c & bench.h`: The API for the making the `format/` directory. \ No newline at end of file diff --git a/bench/bench.h b/bench/bench.h deleted file mode 100644 index fc226d9..0000000 --- a/bench/bench.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef TINYFF_BENCH_H_ -#define TINYFF_BENCH_H_ - -#include -#include - -#define FF_BENCH_MAX_MARKERS 32 - -typedef struct ff_ctx ff_ctx; - -typedef struct { - const char *label; - clock_t tick; -} ff_bench_marker; - -typedef struct { - const char *label; - clock_t _start; - clock_t _end; - - ff_bench_marker markers[FF_BENCH_MAX_MARKERS]; - int _mcount; -} ff_bench; - -// These need to be inline so they are fast - -static inline void ff_bench_start(ff_bench *b, const char* label) { - b->label = label; - b->_start = clock(); - b->_end = 0; - b->_mcount = 0; - -} - - -static inline void ff_bench_end(ff_bench *b) { - b->_end = clock(); -} - -static inline ff_result ff_bench_mark(ff_bench *b, const char *label) { - if (b->_mcount >= FF_BENCH_MAX_MARKERS) return FF_RESULT_ERROR_OUT_OF_BOUNDS; - - ff_bench_marker m; - m.label = label; - m.tick = clock(); - - b->markers[b->_mcount] = m; - b->_mcount++; - - return FF_RESULT_OK; -} - -static inline double ff_bench_seconds(const ff_bench *b) { - return (double)(b->_end - b->_start) / CLOCKS_PER_SEC; -} - -#endif // TINYFF_BENCH_H \ No newline at end of file diff --git a/bench/src/format/image/png.c b/bench/src/format/image/png.c deleted file mode 100644 index 016f686..0000000 --- a/bench/src/format/image/png.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "bench.h" - -int main(void) -{ - -} -- cgit v1.2.3