feat: add benchmar Make target

This commit is contained in:
samsonium
2026-10-29 03:25:48 +03:00
parent f4c97795fa
commit eeca5e653d
6 changed files with 92 additions and 3 deletions
+11 -1
View File
@@ -1,4 +1,9 @@
.PHONY: build debug-c debug-vm test
.PHONY: build debug-c debug-vm test bench
BENCH_FILE ?= benchmarks/loop.fzs
RUNS ?= 7
WARMUP ?= 2
MAX_ITER ?= 2000000
build:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
@@ -17,3 +22,8 @@ debug-vm: build
test: build
ctest --output-on-failure --test-dir build
# Compile the benchmark once, then measure only VM process execution.
bench: build-release
./build/fzc -o build/benchmark.fzb $(BENCH_FILE)
python3 scripts/benchmark.py --runs $(RUNS) --warmup $(WARMUP) \
--max-iter $(MAX_ITER) --vm ./build/fz --program build/benchmark.fzb