A lightweight, ultra-optimized system fetch tool written in C.
bfetch is designed for absolute maximum speed. It utilizes low-level techniques like inline assembly and memory mapping to achieve performance levels that exceed even purpose-built "fast" tools.
- Blazing Performance: Execution time is typically ~2ms (up to 55x faster than fastfetch).
- Accurate Memory: Directly parses
/proc/meminfoto calculate available memory correctly, excluding cache. - Instant GPU Detection: Scans
/sys/class/drmfor cards instead of traversing the entire PCI bus, usingmmapfor instant model lookup. - Buffered Output: Builds the entire output in memory and flushes with a single
write()syscall. - Universal Package Counting:
- Nix: Deep manifest scanning via
mmapsubstring search. - Pacman: Optimized directory entry counting.
- Flatpak & Snap: Native filesystem-based counting.
- Nix: Deep manifest scanning via
- Zero-Copy Architecture: Minimal memory allocations and no subprocess spawning.
- Aesthetic: Custom professional ASCII art for CachyOS, Gentoo, and Bedrock Linux.
# Build (defaults to fast mode)
make
# Run
./bfetch
# Show Help
./bfetch --Help| Tool | Approx. Time | Approach |
|---|---|---|
| bfetch | ~0.002s | ASM + DRM Lookup + Direct I/O |
| fastfetch | ~0.10s | Optimized C / libpci |
| neofetch | ~0.80s | Shell script |
- CPU: Uses
cpuidinline assembly to fetch the processor brand string. - GPU: Direct
/sys/class/drm/card*lookup to identifying vendor/device IDs, then memory-mapspci.idsfor model name resolution. - Memory: Parses
/proc/meminfoto calculateUsed = Total - Availablewithoutsysinfo()syscall overhead. - I/O: Combined
/etc/os-releaseread for both distro name and system type detection. - Packages: optimized recursive directory counting and memory-mapped manifest scanning.
git clone https://github.com/Mjoyufull/bfetch.git
cd bfetch
make
./bfetchnix run github:Mjoyufull/bfetchAGPL License