aboutsummaryrefslogtreecommitdiff
path: root/src/json/bench_json.c
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-04-08 14:41:33 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-04-08 14:41:33 +0200
commit1a7efd92e7caee5dc6493190ba0915dfd88fa7bb (patch)
tree547b7604889dc8865e4daac1fcb6474fc624f1fc /src/json/bench_json.c
parentbde04c0f3399d40f8e0499328f61613d36deced6 (diff)
Benchmark framework
Diffstat (limited to 'src/json/bench_json.c')
-rw-r--r--src/json/bench_json.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/json/bench_json.c b/src/json/bench_json.c
new file mode 100644
index 0000000..1aeecf0
--- /dev/null
+++ b/src/json/bench_json.c
@@ -0,0 +1,17 @@
+#include "../std/memory.h"
+#include "../std/testing.h"
+#include "../std/types.h"
+#include "json.h"
+
+#define BENCH_FILE "descriptive-1MB.json"
+
+static MemoryFile json_parse_input;
+
+static void setup_json_parse(Arena *a) {
+ json_parse_input = load_file(a, BENCH_FILE);
+}
+
+i32 bench_json_parse(Arena *a) {
+ JSON_parse(a, json_parse_input.content, json_parse_input.size);
+ return 0;
+}