Performance Benchmarks
PraisonAI includes a benchmark suite to measure performance with and without AI SDK loaded.Quick Start
What’s Measured
Import Time
Measures cold start import time:- Core Import: Just the Agent class (no AI SDK)
- AI SDK Import: Loading the
aipackage - Full Import: Complete praisonai module
Memory Usage
Measures heap memory after:- Module import
- Agent creation
- First LLM call
Latency
Measures time for:- Backend resolution
- First API call (with real keys)
- Streaming throughput
Embedding Throughput
Measures vectors per second for batch embeddings.Running Benchmarks
Programmatic
Benchmark Script
Create a benchmark script:Benchmark Results
Typical results on modern hardware:| Metric | Without AI SDK | With AI SDK | Overhead |
|---|---|---|---|
| Core Import | ~25ms | ~25ms | 0ms |
| AI SDK Import | N/A | ~35ms | +35ms |
| Full Import | ~30ms | ~60ms | +30ms |
| Backend Resolution | ~1ms | ~5ms | +4ms |
| Memory (Agent) | ~2MB | ~3MB | +1MB |
Key Findings
- AI SDK adds ~35ms import overhead - Only when actually loaded
- Lazy loading works - AI SDK not loaded until needed
- Memory overhead minimal - ~1MB additional
- No runtime penalty - After initial load, performance is identical

