Get Started
Benchmarks
Performance measurements for AgenticReality v0.1.0. All benchmarks were
Performance measurements for AgenticReality v0.1.0. All benchmarks were
run on a MacBook Pro M2 (16 GB RAM) using cargo bench with Criterion.
Test Environment
| Property | Value |
|---|---|
| OS | macOS 14.2 (Sonoma) |
| CPU | Apple M2, 8 cores |
| RAM | 16 GB unified |
| Rust | 1.75.0 |
| Profile | release, LTO enabled |
| Iterations | 1000 per benchmark |
Core Engine Operations
Sensing
| Operation | Median | p99 | Allocation |
|---|---|---|---|
| sense_environment | 18 ms | 42 ms | 4.2 KB |
| sense_resources | 31 ms | 87 ms | 6.8 KB |
| full_sense (all domains) | 52 ms | 110 ms | 12.1 KB |
Sensing operations involve system calls to probe hardware and operating system state. Timings vary based on the number of resources and network interfaces present.
Write Operations
| Operation | Median | p99 | Allocation |
|---|---|---|---|
| initialize_soul | 45 us | 120 us | 1.8 KB |
| update_vitals | 12 us | 28 us | 320 B |
| add_anchor | 18 us | 45 us | 640 B |
| detect_hallucination | 15 us | 38 us | 512 B |
| add_downstream | 22 us | 55 us | 768 B |
| add_deadline | 14 us | 32 us | 480 B |
| set_stakes_level | 8 us | 18 us | 128 B |
| begin_transition | 25 us | 62 us | 1.1 KB |
| run_coherence_check | 380 us | 1.2 ms | 4.5 KB |
Coherence checks are more expensive because they cross-validate all seven domains for contradictions and drift.
Query Operations
| Operation | Median | p99 | Allocation |
|---|---|---|---|
| get_soul | 42 ns | 85 ns | 0 B |
| get_body | 38 ns | 78 ns | 0 B |
| get_layer | 28 ns | 55 ns | 0 B |
| get_downstream | 35 ns | 70 ns | 0 B |
| get_stakes_level | 22 ns | 48 ns | 0 B |
| should_proceed | 2.4 us | 8.1 us | 512 B |
| has_context_shifted | 1.8 us | 5.3 us | 256 B |
| get_fingerprint | 32 ns | 68 ns | 0 B |
Simple queries return references and perform zero allocation. Computed
queries such as should_proceed combine data from multiple domains and
allocate result structures.
Persistence
| Operation | Typical State | Large State | Encrypted |
|---|---|---|---|
| save | 8 ms | 42 ms | 12 ms |
| load | 4 ms | 22 ms | 8 ms |
Typical state: 1 soul, 1 environment, 5 anchors, 10 dependencies, 3 deadlines (approximately 48 KB compressed).
Large state: 50 past lives, 1000 dependencies, 200 anchors, 50 deadlines (approximately 2.4 MB compressed).
Encrypted variants add approximately 4 ms of overhead for AES-256-GCM encryption and decryption.
MCP Tool Calls
| Tool | Simple Op | Complex Op |
|---|---|---|
| reality_deployment | 1.2 ms | 3.8 ms |
| reality_environment | 1.4 ms | 4.2 ms |
| reality_resource | 1.3 ms | 3.5 ms |
| reality_anchor | 1.1 ms | 2.8 ms |
| reality_stakes | 0.9 ms | 3.1 ms |
| reality_coherence | 1.5 ms | 5.2 ms |
| reality_ground | 1.8 ms | 8.5 ms |
Simple operations are single-domain reads (e.g., get_soul). Complex operations involve multi-domain writes or cross-domain computation (e.g., full_sense, reality_check).
MCP overhead (JSON-RPC parsing, parameter validation, result serialisation) adds approximately 0.8 ms per call.
Memory Usage
| Scenario | RSS |
|---|---|
| Base engine, no state | 4.2 MB |
| After initialize + sense | 8.6 MB |
| Typical production deployment | 18 MB |
| Large topology (1000+ deps) | 85 MB |
| Per MCP session overhead | 3.1 MB |
Memory usage scales linearly with the number of topology entities, anchors, and past lives stored.
Comparison with Monitoring Approaches
| Approach | Latency (query) | Memory | Granularity |
|---|---|---|---|
| AgenticReality (in-process) | < 100 ns | 8-50 MB | Per-operation |
| Prometheus pull | 15-30 s | External | Per-scrape-interval |
| StatsD push | 100-500 ms | External | Per-flush-interval |
| Custom health endpoint | 50-200 ms | Varies | Per-request |
AgenticReality operates in-process, giving nanosecond query latency compared to network-based monitoring that operates on seconds-scale intervals. The trade-off is that AgenticReality consumes memory in the agent process.
Scalability Notes
- Anchors: Performance is linear up to approximately 500 anchors. Beyond that, the verify_all operation becomes the bottleneck. Recommend keeping active anchors under 100 for sub-millisecond verification.
- Topology: The topology store handles up to 10,000 entities without degradation. Critical-dependency lookups use the index layer and remain constant-time.
- Past lives: Incarnation memory grows unbounded. Recommend pruning past lives older than 30 days for long-running services.
- Coherence checks: Cost is O(domains * violations). With no violations, checks complete in under 400 microseconds.
Running Benchmarks
cd crates/agentic-reality
cargo bench
# Run a specific benchmark
cargo bench -- sensing
# Generate HTML report
cargo bench -- --output-format htmlBenchmark source files are in benches/ within the core crate.