RCompare
| Developer(s) | AECS4U |
|---|---|
| Initial release | 2025 |
| Written in | Rust |
| Operating system | Linux, Windows, macOS |
| Type | File comparison utility |
| License | MIT / Apache 2.0 |
| Website | github.com/aecs4u/rcompare |
RCompare is a free and open-source file comparison and directory synchronization utility written in Rust. It is designed as a high-performance alternative to commercial file comparison tools, inspired by Beyond Compare and following the architectural patterns of Czkawka.
Features
RCompare provides comprehensive file and directory comparison capabilities with a focus on performance and cross-platform compatibility. The utility offers both command-line and graphical user interfaces, making it accessible to both power users and general audiences.
Core Capabilities
- Directory Comparison: Parallel traversal of directory structures using the jwalk library, enabling efficient comparison of large directory trees
- File Hashing: Utilizes BLAKE3 cryptographic hash function with persistent caching to avoid redundant computations
- Archive Support: Native comparison of compressed archives including ZIP, TAR, TAR.GZ, TGZ, and 7Z formats without extraction
- Pattern Matching: Support for .gitignore files and custom glob patterns for selective comparison
- Multiple Views: Folder view, text diff, hexadecimal comparison, and image comparison modes
User Interfaces
The application is distributed in two variants:
- rcompare_cli: Command-line interface with colored output and JSON export capabilities
- rcompare_gui: Graphical interface built with the Slint UI framework, providing visual file comparison and copy operations
Architecture
RCompare follows a modular workspace structure with strict separation of concerns, adhering to the architectural patterns established by the Czkawka project. The codebase is organized into four primary components:
Component Structure
- rcompare_common
- Shared types, traits, and error definitions used across all components
- rcompare_core
- UI-agnostic business logic including the Virtual File System (VFS) layer, scanner, comparison engine, and hash cache
- rcompare_cli
- Command-line interface implementation with structured logging and JSON output
- rcompare_gui
- Graphical user interface using the Slint declarative UI framework
Key Components
The Virtual File System (VFS) layer provides abstraction over different filesystem types, enabling uniform handling of local filesystems, archive contents, and potentially remote sources. The comparison engine employs a multi-stage verification process using file size, modification timestamps, and BLAKE3 hash values.
Technology Stack
RCompare leverages several notable Rust ecosystem libraries:
Core Dependencies
- BLAKE3: Cryptographic hash function offering speeds up to 3GB/s on modern CPUs
- jwalk: Parallel directory traversal library for efficient filesystem operations
- serde: Serialization framework for JSON output and cache persistence
- clap: Command-line argument parsing for the CLI interface
- Slint: Declarative UI framework for the graphical interface
Performance
Performance benchmarks indicate RCompare achieves competitive throughput for file comparison operations:
- Hashing Speed: Approximately 3GB/s utilizing BLAKE3 on modern x86-64 processors
- Parallel Processing: Multi-threaded directory traversal saturates I/O bandwidth on solid-state drives
- Memory Efficiency: Memory usage averages 100-200 bytes per file entry
- Cache Benefits: Persistent hash cache eliminates redundant computation for unchanged files
Usage
RCompare can be invoked from the command line with various options for customizing comparison behavior:
# Basic directory comparison rcompare_cli scan /path/to/left /path/to/right # Comparison with ignore patterns rcompare_cli scan /project /backup -i "*.o" -i "target/" # Show only differences rcompare_cli scan /source /dest --diff-only # Enable hash verification rcompare_cli scan /left /right --verify-hashes # Compare archive files rcompare_cli scan left.zip right.zip # JSON output for scripting rcompare_cli scan /left /right --json
Output Symbols
The command-line interface uses the following symbols to indicate comparison results:
==Identical files!=Different files<<Left-only files (orphans)>>Right-only files (orphans)??Unchecked (same size, not hash-verified)
Development and Release
RCompare is developed using modern Rust development practices with emphasis on memory safety and performance. The project is currently in alpha status (version 0.1.0) with core functionality implemented.
Development Philosophy
The project adheres to several design principles:
- Memory Safety: Written in safe Rust with minimal unsafe code blocks
- Zero-Cost Abstractions: Leverages Rust's performance characteristics for efficient operation
- Privacy-First: No telemetry or network communication; operates completely offline
- Modularity: Clean separation between core logic and user interface code
Licensing
The software is dual-licensed under the MIT License and Apache License 2.0, allowing users to choose the license that best suits their needs. This dual-licensing approach is common in the Rust ecosystem.
Reception and Impact
As an emerging tool in the file comparison space, RCompare represents a modern approach to a classic utility category. By leveraging Rust's memory safety guarantees and performance characteristics, it addresses both the security concerns of native code and the performance limitations of interpreted languages.
Use Cases
Common applications of RCompare include:
- Backup verification and integrity checking
- Code synchronization between development environments
- Deployment validation for production systems
- Directory deduplication and cleanup
- Data migration verification
See Also
- Beyond Compare – Commercial file comparison tool that inspired RCompare
- Czkawka – Rust-based duplicate finder with similar architectural patterns
- BLAKE3 – Cryptographic hash function used by RCompare
- Rust (programming language) – Systems programming language used to implement RCompare
- File comparison – General category of utility software