Measured latency, throughput, and resource consumption across AgentCTX components.
| Operation | TypeScript | Rust Native | WASM |
|---|
| Parse (simple) | 0.08ms | 0.004ms | 0.01ms |
| Parse (complex, filters + payload) | 0.15ms | 0.008ms | 0.02ms |
| Parse (hybrid mode) | 0.25ms | 0.012ms | 0.03ms |
| ParseMulti (10 statements) | 0.90ms | 0.04ms | 0.10ms |
| Target | TypeScript | Rust Native | Speedup |
|---|
| human | 0.8ms | 0.008ms | 100x |
| surrealql | 0.5ms | 0.005ms | 100x |
| mcp-jsonrpc | 0.3ms | 0.003ms | 100x |
| Batch (10 stmts, human) | 5.2ms | 0.05ms | 104x |
End-to-end latency through the 15-stage middleware pipeline:
| Operation | p50 | p95 | p99 |
|---|
?t (tool search) | 2ms | 5ms | 12ms |
>t (tool call) | 15ms | 45ms | 120ms |
?k (knowledge search) | 8ms | 25ms | 50ms |
+m (memory store) | 3ms | 8ms | 15ms |
?m (memory search) | 5ms | 15ms | 30ms |
?i (inspection) | 1ms | 2ms | 5ms |
Tool call latency is dominated by the backend MCP server, not the gateway.
| Operation | Throughput | Latency |
|---|
| Encode (Rust) | 2.1M ops/sec | 0.47μs |
| Decode (Rust) | 2.4M ops/sec | 0.42μs |
| Encode (TypeScript) | 480K ops/sec | 2.1μs |
| Decode (TypeScript) | 520K ops/sec | 1.9μs |
| Component | RSS (idle) | RSS (active) |
|---|
| Gateway (TypeScript) | 45MB | 80–120MB |
| Gateway (Rust) | 8MB | 15–30MB |
| SurrealDB | 50MB | 100MB–1GB |
| NATS | 15MB | 30–60MB |
| Query Type | Records | p50 | p95 |
|---|
| Memory lookup by ID | 1 | 0.3ms | 0.8ms |
| Memory search (HNSW, k=5) | 10K | 2ms | 5ms |
| Memory search (HNSW, k=5) | 100K | 4ms | 10ms |
| Knowledge search (HNSW, k=3) | 50K chunks | 3ms | 8ms |
| LIVE SELECT subscription | — | 0.5ms | 1.5ms |
All measurements taken on:
- CPU: AMD Ryzen 9 7950X (16C/32T)
- RAM: 64GB DDR5
- Storage: NVMe SSD
- OS: Ubuntu 22.04 / Windows 11
- Node.js: v22.x
- Rust: 1.82+