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.
Use parallel workers
Section titled “Use parallel workers”The single biggest speedup for large repos:
nfr-review report ./my-repo --workers 8Workers parallelise collector execution across threads. Start with the number of CPU cores and adjust based on I/O vs. CPU balance.
Exclude test directories
Section titled “Exclude test directories”By default, test directories are excluded from analysis. If you’ve disabled this, re-enable it:
nfr-review report ./my-repo --exclude-testsThis skips scanning tests/, test/, __tests__/, spec/, and fixture
directories, significantly reducing file I/O for repos with large test suites.
Skip unnecessary collectors
Section titled “Skip unnecessary collectors”If you know certain collectors aren’t relevant, skip them:
collectors: skip: - graphify # graph analysis is expensive for large repos - jacoco-report # skip if no JaCoCo reports - gatling # skip if no Gatling reportsEach skipped collector saves one pass over the file tree.
Use tech overrides
Section titled “Use tech overrides”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 analysisContainer mode in CI
Section titled “Container mode in CI”The container execution mode avoids pip dependency resolution on every run:
- uses: JimAKennedy/nfr-review@v1 with: execution: "container" path: . workers: 4Image layers are cached, so subsequent runs start faster.
Selective scanning
Section titled “Selective scanning”For very large monorepos, scan only the directories that changed:
# In CI, identify changed pathsCHANGED=$(git diff --name-only origin/main...HEAD | cut -d/ -f1-2 | sort -u)
# Scan each changed directoryfor dir in $CHANGED; do if [ -d "$dir" ]; then nfr-review run "$dir" --output-dir results/ fidoneTimeouts
Section titled “Timeouts”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