Skip to main content
Verify your agent stack meets performance targets — import under 200 ms, heavy deps loaded only when needed.
from praisonaiagents import Agent

# Silent output (default) keeps import overhead minimal
agent = Agent(name="Bench", instructions="You are helpful.")
result = agent.start("Say hello in one word")
The user runs a lightweight agent; benchmarks verify import time and lazy-loading stay within targets.

Quick Start

1

Simple Usage

Run the built-in benchmark from the CLI:
pip install praisonai
praisonai perf benchmark
2

With Configuration

Add a CI gate that fails on regressions:
# .github/workflows/perf.yml
name: Performance Check
on: [push, pull_request]
jobs:
  perf:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - run: pip install praisonaiagents
      - run: |
          python -c "
          import time
          start = time.perf_counter()
          import praisonaiagents
          elapsed = (time.perf_counter() - start) * 1000
          print(f'Import time: {elapsed:.1f}ms')
          assert elapsed < 300, f'Import too slow: {elapsed}ms'
          "

Performance Targets

MetricTargetHard failDescription
Import time< 200 ms> 300 msTime to import praisonaiagents
Memory usage< 30 MB> 45 MBMemory after import
Lazy importsAll lazyAny eagerHeavy deps not loaded at import

How It Works

CLI commands

praisonai perf benchmark    # Full suite
praisonai perf import-time  # Import time only
praisonai perf memory       # Memory usage only
praisonai perf lazy-check   # Verify lazy imports

Python benchmark scripts

From the SDK repo:
python benchmarks/import_time.py
python benchmarks/memory_usage.py

Configuration Options

OptionTypeDefaultDescription
outputstr"silent"Silent mode avoids loading Rich at import
Import gateCI threshold300 msHard fail limit for CI pipelines
Lazy modulessys.modules checklitellm, chromadb, mem0, requests
Typical results on a modern system:
MetricTargetTypical
Import time< 200 ms~140 ms
Agent instantiation< 50 μs~8 μs
Memory per agent< 10 KB~4 KB
Heavy depsLazyLazy

Best Practices

output="silent" is the default — zero Rich overhead on the hot path. Keep it for APIs and batch jobs.
Prefer from praisonaiagents import Agent over star imports to minimise load time.
Add the 300 ms assert to your pipeline so lazy-loading regressions fail early.
For embedded or high-volume use, from praisonaiagents.lite import LiteAgent reduces memory further.

Lazy Imports

How lazy loading keeps startup fast

Performance CLI

CLI commands for benchmarking and regression checks