super fast code stats.
a simple tool to count lines, detect languages, and scan big codebases fast.
Warning
development moved to - cstat-v2
most tools are either slow or heavy.
this one is built to be fast and lightweight.
- ⚡ faster than tokei
- 🧠 low cpu + memory usage
- 📂 scans huge folders in seconds
- 🌍 120+ languages, 250+ extensions
cstat [FLAGS] [OPTIONS] [PATH]
🔧 Help:
[FLAGS]
-h, --help show help
-q, --quiet suppress config output
-f, --fast fast scan (skip some stats)
-l, --languages list supported languages
-j, --json output in json format
-c, --csv output in csv format
-ng, --no-gitignore ignore .gitignore rules
-v, --version show version
[OPTIONS]
-t, --threads <n> number of threads
-min, --min-file-size <mb> minimum file size
-max, --max-file-size <mb> maximum file size (max 100MB)
--exclude-dir <dir> exclude directory
--exclude-ext <ext> exclude file extension
git clone https://github.com/nchhillar2004/cstat.git
cd cstat
cmake -B build
cmake --build build --config Release
tested on real-world data. same machine, same conditions.
full system scan (mixed files, binaries, configs, everything)
| tool | files scanned | lines | time (real) | cpu (user) | status |
|---|---|---|---|---|---|
| cstat | 552,108 | 137.2M | 23.78s | 6.53s | ✅ success |
| tokei | 247,591 | 60.6M | 10.62s | 78.11s | ✅ success |
| scc | - | - | - | - | ❌ crashed |
| cloc | - | - | 10m+ | - |
- cstat scans 2x+ more data than tokei
- uses much lower CPU
- scc could not complete the scan
- cloc is significantly slower on large directories
repo: https://github.com/microsoft/vscode
size: ~122MB
| tool | files | lines | time (real) | cpu (user) | status |
|---|---|---|---|---|---|
| cstat | 9,176 | 3.10M | 0.059s | 0.226s | ✅ fastest |
| tokei | 8,900 | 3.09M | 0.278s | 2.795s | ✅ |
| scc | 9,060 | 3.06M | 0.309s | 2.303s | ✅ |
| cloc | 8,887 | - | 39.160s | 38.544s |
- cstat is ~4x faster than tokei
- significantly lower CPU usage
- cloc is much slower on same dataset
repo: https://github.com/nodejs/node
size: ~601MB
| tool | files | lines | time (real) | cpu (user) | status |
|---|---|---|---|---|---|
| cstat | 44,243 | 16.3M | 0.186s | 0.783s | ✅ fastest |
| tokei | 42,777 | 16M | 0.944s | 10.481s | ✅ |
| scc | 42,999 | 16.1M | 1.172s | 9.182s | ✅ |
| cloc | 39,023 | - | 1m30s | 1m29s |
- cstat is ~5x faster than tokei
- significantly lower CPU usage