RCompare

From the Free Software Encyclopedia
RCompare
Developer(s) AECS4U
Initial release 2026
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 project offers command-line, desktop GUI, and C API surfaces, making it suitable for both interactive and automated workflows.

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
  • Specialized Comparison Modes: Text, image, CSV, Excel, JSON, YAML, and Parquet-aware comparisons
  • Patch Engine: Patch parse/manipulate/apply/unapply/serialize workflows for multiple diff formats

User Interfaces

The project currently exposes multiple user and integration interfaces:

  • rcompare_cli: Command-line interface with colored output and JSON export capabilities
  • rcompare_gui: Graphical interface built with the Slint UI framework
  • rcompare_pyside: PySide6 desktop interface with multi-session and profile-oriented workflows
  • rcompare_ffi: libkomparediff2-compatible C API for patch/diff integration

Architecture

RCompare follows a modular workspace structure with strict separation of concerns, adhering to architectural patterns established by Czkawka-inspired projects. The codebase is organized into multiple focused crates:

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
rcompare_pyside
PySide6 graphical interface with persistent per-user session management
rcompare_ffi
C API layer for patch parsing and manipulation workflows

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 + PySide6: Dual desktop GUI technology stack

Performance

Performance benchmarks indicate RCompare achieves competitive throughput for file comparison operations:

  • Hashing Speed: Approximately 3GB/s per core utilizing BLAKE3 on modern x86-64 processors
  • Parallel Hashing: Multi-threaded hash computation for batch workloads
  • Parallel Processing: Multi-threaded directory traversal saturates I/O bandwidth on solid-state drives
  • 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

# Plan synchronization without applying changes
rcompare_cli sync /left /right --direction bidirectional --dry-run --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, performance, and CI/CD automation. Releases publish platform-specific CLI and Slint GUI binaries, while PySide6 and FFI components are maintained in the same workspace.

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