벤치마킹
adk-bench 크레이트와 cargo adk bench 명령은 ADK-Rust 에이전트에 대한 실제 LLM 벤치마킹을 제공합니다. 합성 마이크로벤치마크와 달리 adk-bench는 실제 모델 호출을 통해 엔드투엔드 성능을 측정하여 프레임워크 오버헤드와 제공자 지연 시간을 분리합니다.
측정 대상
| 지표 | 설명 |
|---|---|
| 콜드 스타트 | 프로세스 시작부터 첫 LLM 응답까지의 시간 |
| 에이전트 루프 오버헤드 | 도구 호출 왕복당 프레임워크 비용(LLM 대기 시간 제외) |
| 처리량 | 지속적인 부하에서 초당 요청 수 |
| 메모리 | 실행 중 최대 RSS |
| 토큰 오버헤드 | 프레임워크 계측으로 추가된 토큰 |
| CV (변동 계수) | 실행 간 측정값의 안정성 |
빠른 시작
# Run all benchmarks with default settings
cargo adk bench
# Run a specific workload
cargo adk bench --workload simple_tool_call
# Dry run (no LLM calls, validates config only)
cargo adk bench --dry-run
CLI 참조
cargo adk bench [OPTIONS]
OPTIONS:
--workload <NAME> Run a specific workload (simple_tool_call,
multi_step_reasoning, parallel_tool_invocation)
--iterations <N> Number of iterations per workload [default: 10]
--warmup <N> Warmup iterations before measurement [default: 2]
--provider <NAME> LLM provider to benchmark [default: gemini]
--model <MODEL> Model ID to use [default: gemini-3.5-flash-lite]
--output <FORMAT> Output format: table, json, csv [default: table]
--output-file <PATH> Write results to file instead of stdout
# Cost control
--dry-run Validate configuration without making LLM calls
--max-cost-usd <AMOUNT> Abort if estimated cost exceeds this amount
--confirm-cost Prompt for confirmation before running
# Regression detection
--save-baseline <NAME> Save results as a named baseline
--check-regression <NAME> Compare against a saved baseline
--tolerance <PERCENT> Regression threshold percentage [default: 10]
# External comparison
--ebp Enable External Benchmark Protocol output
--harness <PATH> Path to external framework harness config
비용 제어
벤치마크는 실제 LLM 호출을 수행합니다. 예상치 못한 청구를 방지하려면 다음 플래그를 사용하세요.
# Preview what would run without spending anything
cargo adk bench --dry-run
# Set a hard cost ceiling
cargo adk bench --max-cost-usd 5.00
# Require manual confirmation after cost estimate
cargo adk bench --confirm-cost
비용 추정기는 이전 실행의 토큰 수(또는 워크로드 정의에서 추정한 값)에 제공업체가 공개한 토큰당 가격을 곱하여 계산합니다.
회귀 감지
릴리스 전반에서 성능을 추적합니다.
# Establish a baseline after a release
cargo adk bench --save-baseline v1.0.0
# On the next change, check for regressions
cargo adk bench --check-regression v1.0.0 --tolerance 10
# Tighter tolerance for critical paths
cargo adk bench --workload simple_tool_call --check-regression v1.0.0 --tolerance 5
종료 코드:
0— 회귀가 감지되지 않음1— 하나 이상의 지표가 허용 범위를 넘어 회귀함2— 구성 또는 런타임 오류
기준선은 .adk-bench/baselines/에 JSON 파일로 저장됩니다.
외부 프레임워크 비교(EBP)
외부 벤치마크 프로토콜(EBP)은 다른 에이전트 프레임워크와 일대일 비교를 가능하게 합니다. EBP는 표준 워크로드 형식과 측정 프로토콜을 정의하므로 구현 간 결과를 비교할 수 있습니다.
# Output EBP-compatible results
cargo adk bench --ebp --output json > results.json
# Run against an external harness (e.g., LangGraph, Python SDK)
cargo adk bench --harness harnesses/langraph.toml
하네스 구성 파일은 동일한 워크로드로 외부 프레임워크를 호출하고 동일한 방법론을 사용하여 결과를 측정하는 방법을 정의합니다.
벤치마크 결과
ADK-Rust과 다른 프레임워크를 비교한 공개 결과(결정론적 구성, 동일한 모델, 동일한 워크로드):
| 지표 | ADK-Rust | Gemini Python SDK | LangGraph |
|---|---|---|---|
| 콜드 스타트 | 109 ms | 501 ms | 502 ms |
| 루프 오버헤드 | 568 μs | 253 μs | 1228 ms |
| simple_tool_call | 총 1.2초 | 총 1.8초 | 총 2.1초 |
| multi_step_reasoning | 총 4.1초 | 총 5.9초 | 총 7.3초 |
| parallel_tool_invocation | 총 2.3초 | 총 3.7초 | 총 4.8초 |
방법론:
- 실제 Gemini 3.5 Flash-Lite 호출(모의 호출 아님)
- 결정론적 구성:
temperature=0, 고정 시드 - 워밍업 실행 2회 후 10회 반복
- 오버헤드 격리: 전체 시간에서 측정된 LLM 지연 시간 차감
- 모든 프레임워크에서 동일한 도구 정의와 프롬프트 사용
워크로드
simple_tool_call
단일 사용자 메시지 → 도구 호출 1회 → 응답 1회. 최소 왕복 오버헤드를 측정합니다.
multi_step_reasoning
각 단계 사이에 추론이 필요한 3~5회의 순차적 도구 호출로 이루어진 다중 턴 대화입니다. 지속적인 루프 성능을 측정합니다.
parallel_tool_invocation
단일 사용자 메시지가 3회의 병렬 도구 호출을 트리거합니다. 동시 디스패치 오버헤드를 측정합니다.
프로그래밍 방식 사용
use adk_bench::{BenchmarkSuite, BenchConfig, Workload};
let config = BenchConfig::builder()
.iterations(10)
.warmup(2)
.provider("gemini")
.model("gemini-3.5-flash-lite")
.build()?;
let suite = BenchmarkSuite::new(config);
let results = suite.run_all().await?;
for result in &results {
println!("{}: cold_start={}ms overhead={}μs",
result.workload,
result.cold_start_ms,
result.loop_overhead_us,
);
}
추가 참고 자료
다음 항목은 adk-bench/README.md를 참조하세요.
- 사용자 지정 워크로드 정의
- 하네스 작성 가이드
- CI 통합 패턴
- 과거 결과 추적