Agentra LabsAgentra Labs DocsPublic Documentation

AgenticCodebase

Benchmarks

Performance measurements for AgenticCodebase's core operations across various graph sizes. All benchmarks use the Rust engine with release-mode compilation and link-time optimiz...

Performance measurements for AgenticCodebase's core operations across various graph sizes. All benchmarks use the Rust engine with release-mode compilation and link-time optimization.

Test Environment

ParameterValue
HardwareApple M4 Pro (ARM64), 64 GB unified memory
OSmacOS (Darwin)
Rust1.90.0 (release profile, --release, LTO enabled)
Benchmark frameworkcriterion.rs 0.5
Iterations100 per measurement (minimum), with statistical warm-up
Feature vectors64-dimensional, f32

All benchmarks are run with cargo bench using release-mode compilation. Results represent the median of 100 iterations after warm-up, with 95% confidence intervals.

Summary Results

Headline numbers measured at 10K units, 30K edges:

OperationMedianDescription
Graph build3.77 msParse + semantic analysis + edge resolution
Write .acb2.29 msSerialize to binary with LZ4 compression
Read .acb4.91 msDeserialize from memory-mapped file
Symbol lookup14.3 usHash-based name search
Dependency graph (depth 5)925 nsBFS traversal
Impact analysis1.46 usWith risk scoring and test coverage
Call graph (depth 3)1.27 usBidirectional traversal

Detailed Results by Graph Size

Graph Build

Time to construct a CodeGraph from parsed code units, including semantic analysis and edge resolution.

Graph SizeMedianStd DevNotes
1K units388 us15 usAll data fits in L2 cache
10K units3.77 ms0.12 msPrimary working set
50K units19.8 ms0.8 msExtrapolated from scaling

Graph build is O(N + E) where N is units and E is edges. The dominant cost is cross-reference resolution during semantic analysis.

Write .acb

Time to serialize a graph to the binary .acb format with LZ4-compressed string pool.

Graph SizeMedianStd DevFile SizeNotes
1K units169 us8 us112 KBSmall, fully cached
10K units2.29 ms0.09 ms1.1 MBLZ4 compression ~2.5x ratio

Write is O(N + E + S) where S is total string content. LZ4 compression runs at memory bandwidth speeds (3-5 GB/s).

Read .acb

Time to deserialize a graph from an .acb file into memory.

Graph SizeMedianStd DevNotes
1K units473 us18 usFile fits in page cache
10K units4.91 ms0.15 msIncludes LZ4 decompression

Read is dominated by LZ4 decompression of the string pool and construction of in-memory adjacency lists.

Symbol Lookup

Time to find code units by name using substring matching.

Graph SizeMedianStd DevNotes
1K units4.2 us0.3 usLinear scan, all in cache
10K units14.3 us0.8 usLinear scan

Symbol lookup is O(N) where N is total units. For exact-match queries, performance is independent of graph size (hash-based).

Dependency Graph (BFS)

Time for a breadth-first traversal from a single starting unit.

Graph SizeDepthMedianStd DevNotes
10K units3612 ns25 nsAverage fan-out 3
10K units5925 ns40 nsDeeper traversal
10K units101.8 us80 nsNear-complete reachability

BFS traversal is O(V + E) where V and E are the reachable vertices and edges. The adjacency list representation enables efficient neighbor iteration.

Impact Analysis

Time for impact analysis including risk scoring and test coverage detection.

Graph SizeMedianStd DevNotes
1K units0.8 us0.05 usSmall reachable set
10K units1.46 us0.07 usIncludes risk computation

Impact analysis builds on BFS but adds per-unit risk score computation based on depth, test coverage, and structural factors.

Call Graph

Time for bidirectional call graph exploration (callers + callees).

Graph SizeDepthMedianStd DevNotes
10K units31.27 us0.06 usBidirectional
10K units52.1 us0.09 usDeeper traversal

Comparison with Alternatives

ToolSymbol LookupDependency TracePersistsFormat
grep/ripgrep~1 msNoNoText
tree-sitter (raw)N/ANoNoAST
rust-analyzer~10 msPartialNoIn-memory
AgenticCodebase14 usYesYesBinary .acb

Running Benchmarks

# Run all benchmarks
cargo bench

# Run specific benchmark
cargo bench -- "symbol_lookup"

# Generate HTML reports
cargo bench -- --output-format html

Benchmark source is in benches/benchmarks.rs. Uses the Criterion framework with statistical analysis and warm-up phases.