Skip to content

Performance on a large codebase

Very large projects put real pressure on memory and I/O. Slow parsing, long report times, or instability on a big codebase almost always trace back to too little RAM, slow disk placement, or analyzing more than you need. Work through the areas below.

Size the machine for the codebase

  • Plan for roughly 1 GB of RAM per million lines of code. Systems short on memory show up as slow parsing, long report generation, or instability.
  • Allocate as much RAM as you can to the machine running the analysis.

Put the project database on a local disk

Source code can live on a network drive, but the .und project should be on a fast local disk (SSD recommended). Keeping the database local minimizes I/O latency during parsing and analysis. For moving, shrinking, and backing up the database itself, see Manage the .und database.

Parse very large systems from the command line

For extremely large projects (on the order of 8 million source lines or more), parsing in the GUI is inefficient. Use the und command-line parser to run parsing in batch, and schedule it overnight or during off-hours so it doesn't compete with interactive work:

und analyze -changed MyProject.und

See Run Understand from the command line and the headless workflow.

Be selective about reports and scope

  • Generate only the reports you need. Some are far more expensive than others — the Invocation Tree report in particular can consume significant memory and time on large systems. Automate report generation with und and run it off-hours.
  • Limit analysis scope. You often get the insight you need without parsing every file in full detail. Exclude generated code, third-party trees, and directories you never inspect. Configure which files are analyzed with settings & file filters.

Trade accuracy for speed where it's acceptable

For C/C++, the parser's Strict mode is the most accurate but the slowest; Fuzzy mode is much faster at some cost to precision. Choose deliberately based on what you need from the project — see Accurate C/C++ projects (Strict vs Fuzzy).

Quick checklist

  • ~1 GB RAM per MLOC; add more if you can.
  • .und on a local SSD (source may stay on the network).
  • und batch parse for the biggest projects, scheduled off-hours.
  • Skip expensive/unneeded reports (e.g. Invocation Tree).
  • Exclude code you don't need to analyze.