This guide provides recommendations for optimizing Git Spark's performance when analyzing large repositories and generating reports.
Based on testing with the git-spark repository itself and various open-source projects:
| Repository Size | Commits | Files | Analysis Time | Memory Usage |
|---|---|---|---|---|
| Small | <1,000 | <500 | <5 seconds | <100MB |
| Medium | 1,000-10,000 | 500-2,000 | 10-30 seconds | 100-300MB |
| Large | 10,000-100,000 | 2,000-10,000 | 1-5 minutes | 300-500MB |
| Very Large | >100,000 | >10,000 | 5-15 minutes | 500MB-1GB |
Note: Actual performance depends on hardware (CPU, disk I/O), repository structure, and analysis options.
The most effective way to improve performance is to limit the analysis window:
# Analyze only the last 30 days (fastest)
git-spark --days=30
# Analyze a specific quarter
git-spark --since=2026-01-01 --until=2026-03-31
# Analyze last 7 days for quick health checks
git-spark --days=7 --format=consoleImpact: Reducing from 1 year to 30 days can improve speed by 10-20x for large repositories.
Analyze specific branches instead of the entire repository:
# Analyze only main branch
git-spark --branch=main
# Analyze feature branch
git-spark --branch=feature/new-analyticsImpact: 30-50% faster for repositories with many branches.
Skip documentation, configuration, and generated files:
# Exclude markdown and text files
git-spark --exclude-extensions=.md,.txt
# Exclude multiple file types
git-spark --exclude-extensions=.md,.txt,.log,.json,.xml,.yaml,.yml
# Focus only on source code
git-spark --exclude-extensions=.md,.txt,.json,.xml,.yaml,.yml,.lock,.sumImpact: 20-40% faster analysis and smaller reports for documentation-heavy repositories.
For rapid analysis during development:
# Quick console output (no HTML generation)
git-spark --days=7 --format=console
# JSON for automation (faster than HTML)
git-spark --days=30 --format=json --output=./reportsImpact: Console format is 5-10x faster than HTML for large datasets.
The --heavy flag enables expensive analyses. Skip it for initial exploration:
# Standard analysis (default, faster)
git-spark --days=30
# Heavy analysis (more detailed, slower)
git-spark --days=30 --heavyImpact: Heavy mode adds 20-30% to analysis time but provides deeper insights.
Git Spark uses streaming processing to handle large repositories efficiently.
The default buffer size (200MB) works well for most repositories:
{
"performance": {
"maxBuffer": 200,
"chunkSize": 1000
}
}Increase buffer size in .git-spark.json:
{
"performance": {
"maxBuffer": 500,
"chunkSize": 2000
}
}Warning: Higher buffer sizes increase memory usage but improve performance for large datasets.
Reduce buffer size for low-memory systems (e.g., CI/CD runners):
{
"performance": {
"maxBuffer": 50,
"chunkSize": 500
}
}Large HTML reports use progressive loading for performance:
- Initial render: First 50 rows
- Click "Show more": Load additional rows incrementally
- Full dataset embedded as JSON for export
This keeps initial load time fast even for repos with 1000+ authors or files.
Dark mode uses CSS variables for instant theme switching with minimal overhead. No re-rendering required.
Git Spark uses native SVG charts instead of Chart.js:
Benefits:
- No external JavaScript loading
- Smaller bundle size
- Faster initial page load
- Offline-capable reports
Optimize for CI/CD environments:
- name: Run git-spark analysis
run: |
git-spark --days=7 --format=json --output=./reports
# Skip heavy analysis in CICache the .git-spark-cache directory between runs:
- uses: actions/cache@v3
with:
path: .git-spark-cache
key: git-spark-cache-${{ github.sha }}
restore-keys: |
git-spark-cache-Impact: 50-70% faster subsequent CI runs when Git history and generated artifacts are reused.
Git Spark performs many small file reads. SSD storage provides:
- 5-10x faster analysis on large repositories
- Better performance for Git Spark cache and generated reports
Place cache on fastest available disk:
{
"performance": {
"cacheDir": "/path/to/fast/disk/.git-spark-cache"
}
}- Check disk I/O: Use
iostator Task Manager to monitor disk activity - Verify Git performance: Run
git log --oneline | wc -lto test git speed - Disable heavy analysis: Test without
--heavyto isolate expensive calculations - Reduce date range: Test with
--days=7to verify baseline performance
- Reduce buffer size in
.git-spark.json - Use smaller chunks: Set
chunkSize: 500or lower - Limit analysis range: Use
--daysto reduce dataset - Check for memory leaks: Update to latest version
- Check report size: HTML files >10MB may load slowly
- Use JSON instead: For programmatic access, JSON is faster
- Reduce analysis range: Fewer commits = smaller HTML
- Limit hotspot tables: Configure
maxHotspotsin.git-spark.json
The easiest way to create a .git-spark.json configuration file is with the interactive wizard:
# Interactive setup with prompts
git-spark init
# Quick setup with defaults
git-spark init --yesThe wizard guides you through setting days to analyze, output format, and file exclusions.
{
"analysis": {
"excludeExtensions": [".md", ".txt", ".log"],
"excludeAuthors": ["dependabot[bot]", "github-actions[bot]"]
},
"performance": {
"maxBuffer": 300,
"enableCaching": true,
"cacheDir": ".git-spark-cache",
"chunkSize": 1500
},
"output": {
"defaultFormat": "json",
"outputDir": "./reports"
}
}{
"performance": {
"maxBuffer": 50,
"enableCaching": true,
"chunkSize": 500
},
"output": {
"defaultFormat": "console",
"outputDir": "./reports"
}
}- ✅ Start small: Use
--days=7for initial testing - ✅ Use caching: Enable all caching options for repeated analysis
- ✅ Exclude non-code files: Use
--exclude-extensionsfor faster analysis - ✅ Choose right format: Console for quick checks, JSON for automation, HTML for presentations
- ✅ Monitor resources: Watch memory and disk I/O during analysis
- ✅ Update regularly: New versions often include performance improvements
- ✅ Use SSD storage: Dramatically improves I/O-bound operations
- ✅ Cache in CI/CD: Reuse
.git-spark-cachebetween runs
Git Spark Repository (small):
- Commits: ~138 (at v1.3.0)
- Analysis time: 2-3 seconds
- HTML size: ~500KB
- Memory: ~50MB
Medium Open Source Project:
- Commits: ~5,000
- Analysis time: 15-20 seconds
- HTML size: ~2MB
- Memory: ~200MB
Large Enterprise Repository:
- Commits: ~50,000
- Analysis time: 2-3 minutes
- HTML size: ~8MB
- Memory: ~400MB
If you experience persistent performance issues:
- Check GitHub Issues for known issues
- Run with
--log-level=debugto diagnose problems - Share performance metrics when reporting issues:
- Repository size (commits, files, authors)
- Analysis time
- Memory usage
- System specifications
Last Updated: July 2026 Git Spark Version: 1.4.0+