Simple Go-style benchmarks for measuring SDK overhead.
./run_benchmark.sh [duration_seconds]This automatically:
- Starts the delay server
- Runs baseline benchmark (SDK disabled)
- Runs benchmark with SDK enabled
- Prints comparison with overhead percentages
# Terminal 1: Start delay server
python delay_server.py
# Terminal 2: Run baseline (SDK disabled)
TUSK_DRIFT_MODE=DISABLED python app.py
# Terminal 3: Run benchmark
python benchmark.py --url=http://localhost:8080
# Terminal 2: Restart with SDK enabled
# Ctrl+C, then:
TUSK_DRIFT_MODE=RECORD python app.py
# Terminal 3: Run benchmark again
python benchmark.py --url=http://localhost:8080Benchmark_Sort 1000 1234567 ns/op 810.37 ops/s
Benchmark_Downstream 500 20123456 ns/op 49.69 ops/s
Use the same benchmark.py against Node test server:
python benchmark.py --url=http://localhost:3000