Benchmarks CLI
Run performance benchmarks to compare AI SDK vs Native backends.Commands
Run All Benchmarks
Import Time Benchmark
Memory Benchmark
Latency Benchmark
Streaming Benchmark
Embedding Benchmark
Options
| Option | Description |
|---|---|
--iterations | Number of iterations (default: 5) |
--backend | Backend to test (ai-sdk, native, both) |
--real | Use real API calls (requires keys) |
--json | Output as JSON |
--verbose | Verbose output |
Examples
Quick Performance Check
Full Benchmark Suite
JSON Output
Compare Backends
CI/CD Integration
GitHub Actions
Script Integration
Interpreting Results
Import Time
- < 50ms: Excellent
- 50-100ms: Good
- > 100ms: May need optimization
AI SDK Overhead
- ~35ms: Expected overhead for AI SDK import
- 0ms: AI SDK not loaded (lazy loading working)
Memory
- < 5MB: Normal for Agent creation
- > 10MB: May indicate memory leak
Latency
- < 500ms: Good first-call latency
- > 1000ms: Network or API issues

