A multi-threaded, hardware-accelerated file copier.
tcopy is a high-speed alternative to the standard Windows Copy-Item. It solves the "Small File Bottleneck" by using a work-stealing parallel engine to dispatch multiple copy operations simultaneously, saturating the disk's IO bandwidth.
Tested on a 7-year-old PC with 1,000 small files:
| Command | Avg_ms | Status |
|---|---|---|
| tcopy (Rust) | 759.70 ms | Winner |
| Copy-Item (Win) | 1332.66 ms | Slower |
Result: tcopy is 1.75x faster than the native Windows command.
- Rayon Parallel Engine: Instead of copying one file at a time,
tcopyuses a thread pool to copy several files in parallel. This hides the "latency" (wait time) of the disk. - Kernel-Level Handover: Uses
std::fs::copy, which triggers the low-level OSCopyFileExAPI, moving data efficiently without unnecessary jumps back and forth to the program. - Pre-calculated Tree: The tool maps the entire source directory into a vector before starting. This allows the CPU to plan the most efficient way to "attack" the folders.
To lock the binary to your specific hardware and enable maximum speed:
# Set flags for your CPU
$env:RUSTFLAGS="-C target-cpu=native"
# Build the release binary
cargo build --release# Copy a single file
./tcopy source.txt backup.txt
# Copy an entire folder recursively (Turbo Mode)
./tcopy ./node_modules ./backup_modules