BENCHMARKS := evaluate
FEATURES ?= burn
BENCHMARK ?= $(BENCHMARKS)
ITERATIONS ?= 3
.PHONY: benchmark check profile test
benchmark:
@set -e; \
for name in $(BENCHMARK); do \
executable=$$( \
cargo bench --features $(FEATURES) --bench $$name --no-run --message-format=json \
| sed -n 's/.*"executable":"\([^"]*\)".*/\1/p' \
| tail -n 1 \
); \
test -n "$$executable"; \
"$$executable" "$(ITERATIONS)"; \
done
check:
cargo clippy --all-targets --features $(FEATURES) -- -D warnings
profile:
@mkdir -p target/profiles
@set -e; \
for name in $(BENCHMARK); do \
executable=$$( \
cargo bench --features $(FEATURES) --bench $$name --no-run --message-format=json \
| sed -n 's/.*"executable":"\([^"]*\)".*/\1/p' \
| tail -n 1 \
); \
test -n "$$executable"; \
samply record --save-only --unstable-presymbolicate -o "target/profiles/$$name.json" -- "$$executable" "$(ITERATIONS)"; \
done
test:
cargo test --features $(FEATURES)