-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.8 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.PHONY: demo bench bench-quick bench-full bench-comparison fmt lint test deps-python coverage
demo:
GO111MODULE=on go run ./examples/basic
bench: bench-quick
bench-quick:
@echo "Running quick benchmarks..."
@go test -bench=BenchmarkPool -benchtime=10x ./bench
bench-full:
@echo "Running full benchmark suite..."
@go test -bench=. -benchtime=100x -benchmem ./bench
bench-comparison: deps-python
@echo "Running RPC protocol comparison benchmarks..."
@echo "Installing Python dependencies for RPC servers..."
@pip install -q msgpack 2>/dev/null || true
@echo "Running benchmarks..."
@go test -bench=BenchmarkRPC -benchtime=100x ./bench -v
@echo ""
@echo "=== Benchmark Summary ==="
@go test -bench=BenchmarkRPC -benchtime=100x ./bench 2>/dev/null | grep -E "Benchmark|req/s|μs"
bench-comparison-report: deps-python
@echo "Generating detailed comparison report..."
@go test -bench=BenchmarkRPC -benchtime=1000x ./bench -benchmem > bench_results.txt
@echo "Results saved to bench_results.txt"
@echo ""
@echo "=== Performance Comparison ==="
@cat bench_results.txt | grep -E "Benchmark|req/s|μs" | column -t
deps-python:
@echo "Checking Python dependencies..."
@python3 -c "import msgpack" 2>/dev/null || pip install msgpack
test:
@echo "Running tests..."
@go test -v ./...
fmt:
go fmt ./...
lint:
@echo "Running linters..."
@golangci-lint run ./...
@cd worker/python && ruff check . || true
coverage:
@echo "Running coverage..."
@export GOMODCACHE=$(PWD)/.gomodcache; export GOCACHE=$(PWD)/.gocache; \
pkgs=$$(go list ./internal/... | grep -v '/bench'); [ -z "$$pkgs" ] || TMPDIR=/tmp GOMODCACHE=$(PWD)/.gomodcache GOCACHE=$(PWD)/.gocache go test -covermode=atomic -coverprofile=coverage.out $$pkgs
@GOMODCACHE=$(PWD)/.gomodcache GOCACHE=$(PWD)/.gocache go tool cover -func=coverage.out | tee coverage.txt