qc (Quick Count) 🚀
A faster source code auditor and line counter built in Rust.
qc is designed to give you an instant breakdown of your codebase composition. It uses Memory Mapping (Mmap) and Parallel Directory Walking to scan thousands of files in milliseconds.
Benchmarks
In a head-to-head comparison against tokei on the Linux Kernel source tree, qc performed ~1.8x faster over 100 runs.
| Tool | Mean Time |
|---|---|
| qc | 568.9 ms |
| tokei | 1032 ms |
Features
- High Performance: Leverages all CPU cores and memory-mapped I/O for maximum throughput.
- Deep Insights: Provides line counts for Code, Comments, and Blank lines.
- Language Breakdown: Automatically identifies and categorizes files by extension.
- Smart Composition: Visualizes the ratio of code vs. comments with a terminal heatmap.
- Respectful: Automatically respects
.gitignoreand hidden files (powered byignore).
Installation
From Source
Ensure you have the Rust toolchain installed.
-
Clone the repository:
-
Build and install using the Makefile:
This will place the
qcbinary in your~/.cargo/bindirectory.
Usage
Run qc in any directory to start an audit:
Options
qc [path]- Scan a specific directory.qc -<number>- Limit the "Top Files" list to N results (e.g.,qc -5).qc -h [or] qc --help- Show the help message.
Performance
qc is built to be faster than traditional wc -l loops by using byte-level scanning and avoiding unnecessary UTF-8 validation where possible.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with 🦀 by toast1599