SHELL := /bin/bash
ts := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
.PHONY: help
help:
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
.PHONY: build
build: nightly dev-packages
poetry run maturin build
.PHONY: build-release
build-release: nightly dev-packages
poetry run maturin build --release
.PHONY: nightly
nightly:
rustup override set nightly
.PHONY: install
install: nightly dev-packages
poetry run maturin develop --release
.PHONY: publish
publish:
poetry run maturin publish
.PHONY: clean
clean:
cargo clean
.PHONY: dev-packages
dev-packages:
poetry install
.PHONY: test
test: dev-packages install quicktest
.PHONY: quicktest
quicktest:
poetry run pytest tests
.PHONY: bench
bench:
poetry run pytest benchmarks
.PHONY: bench-compare
bench-compare: nightly dev-packages install
poetry run pytest benchmarks --compare
.PHONY: plot
plot: bench-compare
@echo "Rendering plots from benchmarks"
poetry run python benchmarks/histogram.py
.PHONY: build-profile
build-profile:
cd profiling && poetry run cargo build --release
.PHONY: profile
profile: OUTPUT_PATH = measurements/flame-$(ts).svg
profile: FLAGS=booleans --iterations 10000
profile: nightly build-profile
perf record --call-graph dwarf,16384 -e cpu-clock -F 997 target/release/profiling $(FLAGS)
time perf script | stackcollapse-perf.pl | c++filt | flamegraph.pl > $(OUTPUT_PATH)
@echo "$(OUTPUT_PATH)"