Skip to content

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.

Rigorous evaluation across real-world workloads demonstrates high noise reduction, low latency, and efficient scaling:

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 --compact mode.

Execution Speed vs. Difftastic & Structural Differs

Section titled “Execution Speed vs. Difftastic & Structural Differs”
File Size / Scenariogit diff (Text)difftastic (AST)symtrace Cold (Raw Parse & Diff)symtrace Warm CAS (Cached Retrieval)Cold Speedup vs difftastic
Small File (50 LOC)1.1 ms18.2 ms1.2 ms< 0.004 ms~15.1x faster
Medium File (500 LOC)2.4 ms64.8 ms4.8 ms< 0.004 ms~13.5x faster
Large File (5,000 LOC)8.2 ms412.0 ms18.3 ms< 0.004 ms~22.5x faster
Micro-Edits (1 Line)1.0 ms22.4 ms0.1 ms< 0.004 ms~224.7x faster
  • Cold Execution (Raw Diffing): In raw structural comparison workloads without cache hits, symtrace v0.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, symtrace achieves >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 RwLock striping provides zero lock contention across 32 Rayon worker threads.
  • 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.
  • 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 .scm rules across 1,000 AST nodes in under 1.5 ms per file.
  • Automated Test Suite: 332 tests passing at 100% with zero flakes in ~0.72s.
  1. Two-Tier CAS Diff Caching (DiffCacheKey): Precomputed diff caching keyed by old_blob_oid || new_blob_oid || logic_only || limits_hash returns warm diff records in under 0.004 ms.
  2. SIMD-Vectorized Histograms: Hardware-accelerated bitset popcounts and AVX2/SSE multiset Jaccard eliminate heavy string diff allocations.
  3. Single-Handle Shared Reader (SharedBlobReader): In-process libgit2 byte streaming eliminates process spawning and thread lock contention.
  4. Thread-Local Arena Recycler (BumpaloRecycler): Re-uses bumpalo::Bump arenas and tree_sitter::Parser instances across worker threads.
  5. Parallel Rayon Candidate Indexing: Global multi-file candidate matching executes concurrently across all available CPU cores at O(N log N) complexity.