Performance Benchmarks
PraisonAI Agents includes built-in benchmarks to measure import time, memory usage, and verify lazy imports are working correctly.Performance Targets
| Metric | Target | Hard Fail | Description |
|---|---|---|---|
| Import Time | less than 200ms | greater than 300ms | Time to import praisonaiagents |
| Memory Usage | less than 30MB | greater than 45MB | Memory after import |
| Lazy Imports | All lazy | Any eager | Heavy deps not loaded |
Running Benchmarks
Import Time Benchmark
Memory Benchmark
Lazy Import Check
Using the Benchmark Scripts
The package includes benchmark scripts in thebenchmarks/ directory:
CI/CD Integration
Add performance checks to your CI pipeline:Optimization Tips
Reduce Import Time
- Use specific imports instead of star imports
- Import only what you need
- Defer imports in your own code
Reduce Memory Usage
- Use the lite package for minimal footprint
- Avoid loading unnecessary features
- Clear chat history when not needed
Benchmark Results
Typical results on a modern system:| Metric | v0.4.x | v0.5.0+ | Improvement |
|---|---|---|---|
| Import Time | 820ms | 18ms | 97.8% |
| Memory | 93MB | 33MB | 64.6% |
| litellm loaded | Yes | No | Lazy |
| requests loaded | Yes | No | Lazy |

