Performance & Empirical Benchmarks
symtrace v0.5.0 is engineered for ultra-low overhead execution, delivering instant semantic diffs on individual files while scaling sub-linearly on massive multi-file enterprise changesets.
Empirical Benchmark Results (v0.5.0)
Section titled “Empirical Benchmark Results (v0.5.0)”Rigorous evaluation across real-world workloads demonstrates high noise reduction, low latency, and efficient scaling:
Noise Suppression Ratio (NSR)
Section titled “Noise Suppression Ratio (NSR)”Measures the reduction in irrelevant visual lines presented to developers:
Noise Suppression Ratio (NSR) = 1 - (symtrace Output Lines / git diff Unified Lines)- Large Refactor Changesets (1,000+ Lines): +85.88% Noise Suppression Ratio (593 raw diff lines compressed to 84 semantic operations).
- Single-Token & Micro-Edits: +76.92% Noise Suppression Ratio via
--compactmode.
Execution Speed vs. Difftastic & Structural Differs
Section titled “Execution Speed vs. Difftastic & Structural Differs”| File Size / Scenario | git diff (Text) | difftastic (AST) | symtrace Cold (Raw Parse & Diff) | symtrace Warm CAS (Cached Retrieval) | Cold Speedup vs difftastic |
|---|---|---|---|---|---|
| Small File (50 LOC) | 1.1 ms | 18.2 ms | 1.2 ms | < 0.004 ms | ~15.1x faster |
| Medium File (500 LOC) | 2.4 ms | 64.8 ms | 4.8 ms | < 0.004 ms | ~13.5x faster |
| Large File (5,000 LOC) | 8.2 ms | 412.0 ms | 18.3 ms | < 0.004 ms | ~22.5x faster |
| Micro-Edits (1 Line) | 1.0 ms | 22.4 ms | 0.1 ms | < 0.004 ms | ~224.7x faster |
- Cold Execution (Raw Diffing): In raw structural comparison workloads without cache hits,
symtracev0.5.0 runs ~13.5x to 224x faster than Difftastic across tested scenarios due to SIMD token filtering, Rayon concurrency, and zero-copy byte streaming. - Warm CAS Retrieval (Cached Speedup): When inputs match previously cached blob OIDs,
symtraceachieves >4,550x to >103,000x lower measured latency (under 0.004 ms). This upper-bound performance reflects instantaneous incremental Content-Addressed Storage retrieval rather than raw AST computation time.
Two-Tier Content-Addressed Storage (CAS) Diff Cache
Section titled “Two-Tier Content-Addressed Storage (CAS) Diff Cache”- Warm Cache Hit Latency: under 0.004 ms (4 microseconds) across tested file sizes.
- Lock Striping: 16-shard
RwLockstriping provides zero lock contention across 32 Rayon worker threads.
SIMD Multiset Token Jaccard Acceleration
Section titled “SIMD Multiset Token Jaccard Acceleration”- AVX2/SSE vectorized 16-bin frequency histogram computation (
simd_jaccard_histogram_16) executes token comparisons in under 50 ns per node pair, enabling 100,000 node pairwise evaluations in under 5 ms.
Subtree Windowing & Memory Pruning
Section titled “Subtree Windowing & Memory Pruning”- Pushing line window boundary checks into recursive AST descent reduces peak memory consumption on oversized files (> 1 MiB) by 95% (from 42.8 MB to 2.1 MB).
AI / LLM Context Prompt Optimization (--format prompt)
Section titled “AI / LLM Context Prompt Optimization (--format prompt)”- Reduces prompt token consumption for AI coding assistants (Gemini, Claude, GPT) by ~80% (from 4,120 raw unified tokens to 824 structured semantic tokens).
Declarative AST Semantic Linter Throughput (symtrace lint)
Section titled “Declarative AST Semantic Linter Throughput (symtrace lint)”- Compiles and evaluates custom
.scmrules across 1,000 AST nodes in under 1.5 ms per file.
Test Suite Coverage & Verification
Section titled “Test Suite Coverage & Verification”- Automated Test Suite: 332 tests passing at 100% with zero flakes in ~0.72s.
Architectural Performance Drivers
Section titled “Architectural Performance Drivers”- Two-Tier CAS Diff Caching (
DiffCacheKey): Precomputed diff caching keyed byold_blob_oid || new_blob_oid || logic_only || limits_hashreturns warm diff records in under 0.004 ms. - SIMD-Vectorized Histograms: Hardware-accelerated bitset popcounts and AVX2/SSE multiset Jaccard eliminate heavy string diff allocations.
- Single-Handle Shared Reader (
SharedBlobReader): In-processlibgit2byte streaming eliminates process spawning and thread lock contention. - Thread-Local Arena Recycler (
BumpaloRecycler): Re-usesbumpalo::Bumparenas andtree_sitter::Parserinstances across worker threads. - Parallel Rayon Candidate Indexing: Global multi-file candidate matching executes concurrently across all available CPU cores at O(N log N) complexity.