.PHONY: build build-release build-native test bench bench-all bench-compare clean fmt check clippy bench-docker bench-docker-build bench-docker-file test-workflows test-ci test-release test-job
build:
cargo build
build-release:
cargo build --release
build-native:
RUSTFLAGS="-C target-cpu=native" cargo build --release
test:
cargo test
test-verbose:
cargo test -- --nocapture
bench:
cargo bench
bench-parser:
cargo bench --bench parser_bench
bench-writer:
cargo bench --bench writer_bench
bench-e2e:
cargo bench --bench e2e_bench
bench-throughput:
cargo bench -- parser_throughput
bench-buffers:
cargo bench -- buffer_sizes
bench-all:
@if [ -z "$(FILE)" ]; then \
./scripts/benchmark-all.sh; \
else \
./scripts/benchmark-all.sh "$(FILE)"; \
fi
bench-quick:
./scripts/benchmark-all.sh --sizes 10 --runs 3 --warmup 1
bench-rust-only:
./scripts/benchmark-all.sh --rust-only
bench-compare:
@if [ -z "$(FILE)" ]; then \
./scripts/benchmark.sh; \
else \
./scripts/benchmark.sh "$(FILE)"; \
fi
bench-report:
cargo bench -- --verbose
@echo "Report available at: target/criterion/report/index.html"
profile:
@echo "Profiling split command..."
cargo flamegraph --bin sql-splitter -- split /tmp/benchmark_test.sql -o /tmp/profile-output
fmt:
cargo fmt
check:
cargo check
clippy:
cargo clippy -- -D warnings
clean:
cargo clean
rm -rf /tmp/rs-bench /tmp/go-bench
run-help:
cargo run --release -- --help
size:
@ls -lh target/release/sql-splitter 2>/dev/null || echo "Run 'make build-release' first"
install:
cargo install --path .
uninstall:
cargo uninstall sql-splitter
bench-docker-build:
docker compose -f docker/docker-compose.benchmark.yml build
bench-docker:
./docker/run-benchmark.sh -- --generate
bench-docker-file:
@if [ -z "$(FILE)" ]; then \
echo "Usage: make bench-docker-file FILE=/path/to/dump.sql"; \
exit 1; \
fi
./docker/run-benchmark.sh --file "$(FILE)"
test-workflows:
@command -v act >/dev/null 2>&1 || { echo "Install act: brew install act"; exit 1; }
act --list
test-ci:
@command -v act >/dev/null 2>&1 || { echo "Install act: brew install act"; exit 1; }
act -W .github/workflows/test.yml
test-release:
@command -v act >/dev/null 2>&1 || { echo "Install act: brew install act"; exit 1; }
act -W .github/workflows/release.yml -n
test-job:
@if [ -z "$(JOB)" ]; then echo "Usage: make test-job JOB=lint"; exit 1; fi
act -j $(JOB)