Skip to content

Tuning for Large Repos

Large repositories (50k+ files, deep dependency trees, multiple language ecosystems) can take longer to scan. Here’s how to speed things up.

The single biggest speedup for large repos:

Terminal window
nfr-review report ./my-repo --workers 8

Workers parallelise collector execution across threads. Start with the number of CPU cores and adjust based on I/O vs. CPU balance.

By default, test directories are excluded from analysis. If you’ve disabled this, re-enable it:

Terminal window
nfr-review report ./my-repo --exclude-tests

This skips scanning tests/, test/, __tests__/, spec/, and fixture directories, significantly reducing file I/O for repos with large test suites.

If you know certain collectors aren’t relevant, skip them:

nfr-review.yaml
collectors:
skip:
- graphify # graph analysis is expensive for large repos
- jacoco-report # skip if no JaCoCo reports
- gatling # skip if no Gatling reports

Each skipped collector saves one pass over the file tree.

Auto-detection scans the full repo tree for technology markers. If you know your stack, declare it explicitly to skip detection:

tech:
java: true
spring_boot: true
kubernetes: true
python: false # skip Python analysis
go: false # skip Go analysis

The container execution mode avoids pip dependency resolution on every run:

- uses: JimAKennedy/nfr-review@v1
with:
execution: "container"
path: .
workers: 4

Image layers are cached, so subsequent runs start faster.

For very large monorepos, scan only the directories that changed:

Terminal window
# In CI, identify changed paths
CHANGED=$(git diff --name-only origin/main...HEAD | cut -d/ -f1-2 | sort -u)
# Scan each changed directory
for dir in $CHANGED; do
if [ -d "$dir" ]; then
nfr-review run "$dir" --output-dir results/
fi
done

If a scan is taking too long in CI, set a step timeout:

- name: Run NFR Review
timeout-minutes: 15
uses: JimAKennedy/nfr-review@v1
with:
path: .
workers: 4