Skip to content

Performance

symtrace is competitive with git diff on small changesets and can outperform it on 1-2 file comparisons. On larger changesets, the overhead of parsing and structural analysis is the trade-off for semantic understanding.

Scaling is sub-linear — significantly more code does not mean proportionally more time.

  • Parallel processing — files are parsed and diffed concurrently.
  • Incremental parsing — only the changed parts of a file are re-parsed. This can reduce parse time by up to 46% on files with localized changes.
  • AST caching — parsed syntax trees are cached in memory and on disk, so repeated runs on the same files are faster.
  • Early skip — files with identical content across both commits are skipped entirely.

Every run reports performance data. In CLI output you’ll see:

Performance
Files processed : 3
Nodes compared : 1,204
Parse time : 4.32 ms
Diff time : 1.15 ms
Total time : 18.40 ms
Incremental : 2 file(s), 480 nodes reused

The same data is available in JSON output under the performance key.

If you’re running symtrace on large or untrusted repositories, you can use resource limits to control how much work it does per file:

Terminal window
symtrace . HEAD~1 HEAD --max-file-size 1048576 --max-ast-nodes 50000 --parse-timeout-ms 500

Files that exceed these limits are skipped. See the CLI Reference for all options.

You can also disable incremental parsing with --no-incremental if needed.