Agentra LabsAgentra Labs DocsPublic Documentation

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

PropertyValue
OSmacOS 14.2 (Sonoma)
CPUApple M2, 8 cores
RAM16 GB unified
Rust1.75.0
Profilerelease, LTO enabled
Iterations1000 per benchmark

Core Engine Operations

Sensing

OperationMedianp99Allocation
sense_environment18 ms42 ms4.2 KB
sense_resources31 ms87 ms6.8 KB
full_sense (all domains)52 ms110 ms12.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

OperationMedianp99Allocation
initialize_soul45 us120 us1.8 KB
update_vitals12 us28 us320 B
add_anchor18 us45 us640 B
detect_hallucination15 us38 us512 B
add_downstream22 us55 us768 B
add_deadline14 us32 us480 B
set_stakes_level8 us18 us128 B
begin_transition25 us62 us1.1 KB
run_coherence_check380 us1.2 ms4.5 KB

Coherence checks are more expensive because they cross-validate all seven domains for contradictions and drift.

Query Operations

OperationMedianp99Allocation
get_soul42 ns85 ns0 B
get_body38 ns78 ns0 B
get_layer28 ns55 ns0 B
get_downstream35 ns70 ns0 B
get_stakes_level22 ns48 ns0 B
should_proceed2.4 us8.1 us512 B
has_context_shifted1.8 us5.3 us256 B
get_fingerprint32 ns68 ns0 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

OperationTypical StateLarge StateEncrypted
save8 ms42 ms12 ms
load4 ms22 ms8 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

ToolSimple OpComplex Op
reality_deployment1.2 ms3.8 ms
reality_environment1.4 ms4.2 ms
reality_resource1.3 ms3.5 ms
reality_anchor1.1 ms2.8 ms
reality_stakes0.9 ms3.1 ms
reality_coherence1.5 ms5.2 ms
reality_ground1.8 ms8.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

ScenarioRSS
Base engine, no state4.2 MB
After initialize + sense8.6 MB
Typical production deployment18 MB
Large topology (1000+ deps)85 MB
Per MCP session overhead3.1 MB

Memory usage scales linearly with the number of topology entities, anchors, and past lives stored.

Comparison with Monitoring Approaches

ApproachLatency (query)MemoryGranularity
AgenticReality (in-process)< 100 ns8-50 MBPer-operation
Prometheus pull15-30 sExternalPer-scrape-interval
StatsD push100-500 msExternalPer-flush-interval
Custom health endpoint50-200 msVariesPer-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 html

Benchmark source files are in benches/ within the core crate.