Releases: ImGajeed76/xpatch
Releases · ImGajeed76/xpatch
v0.4.2 - WebAssembly & C/C++ Bindings
🎯 Highlights
- WebAssembly bindings: Universal ~890KB package for browsers, Node.js, Bun, Deno, and edge runtimes
- C/C++ bindings: FFI wrapper enabling Go and other language integrations
- npm package reorganization:
xpatch-rsis now WASM (recommended),xpatch-rs-nativefor maximum performance - ~10µs encode, ~1µs decode for small data in WASM
- 99.88% compression on 10KB files with single-byte changes
Installation
WebAssembly (Browser + Node.js) - Recommended:
npm install xpatch-rsimport init, { encode, decode, get_tag } from "xpatch-rs";
await init();
const delta = encode(0, base, newData, true);
const reconstructed = decode(base, delta);Node.js Native (Maximum Performance):
npm install xpatch-rs-nativePython:
pip install xpatch-rsRust:
[dependencies]
xpatch = "0.4.2"C/C++:
# Build with axogen
axogen run build c
# Or manually
cd crates/xpatch-c && cargo build --releaseNew Bindings
WebAssembly (xpatch-rs on npm)
- Works in browsers, Node.js, Bun, Deno, Cloudflare Workers
- Single ~890KB universal package
- Requires
await init()before use - Full TypeScript definitions included
C/C++ (crates/xpatch-c/)
- FFI wrapper with 6 core functions
- Auto-generated header via cbindgen
- Distribution package with library, header, and docs
- Enables Go and other language bindings
Package Organization
| Package | Registry | Use Case |
|---|---|---|
xpatch-rs |
npm | WASM - browsers & universal Node.js |
xpatch-rs-native |
npm | Native Node.js for max performance |
xpatch-rs |
PyPI | Python bindings |
xpatch |
crates.io | Rust library |
Performance
| Binding | Encode (small) | Decode (small) | Compression |
|---|---|---|---|
| WASM | ~10µs | ~1µs | 99.88% |
| Python | ~7µs | <0.1µs | 99.89% |
| Node Native | ~10-30% faster than WASM | - | 99.88% |
Full Changelog: https://github.com/ImGajeed76/xpatch/blob/master/CHANGELOG.md
GitHub Changelog: v0.3.1...v0.4.2
v0.3.1 - Multi-Language Support & Build Automation
🎯 Highlights
- Multi-language bindings: Python and Node.js support with full API parity
- Axogen build system: Interactive setup, unified commands, auto-generated configs
- CharsZstd algorithm: Improved compression for large continuous insertions
- Enhanced documentation: DEVELOPMENT.md, Rust edition 2024 requirements, improved README
- Repository restructure: Workspace organization with dedicated crates
Multi-Language Support
Python (PyPI: https://pypi.org/project/xpatch-rs/)
pip install xpatch-rs
Node.js (npm: https://www.npmjs.com/package/xpatch-rs)
npm install xpatch-rs
Rust (crates.io: https://crates.io/crates/xpatch)
[dependencies]
xpatch = "0.3.1"All bindings provide identical APIs with comprehensive test coverage.
Axogen Build Automation
- Interactive axogen run setup detects tools and configures environment
- Unified commands: build, test, local, fmt, lint for all languages
- Auto-generates pyproject.toml, package.json, DEVELOPMENT.md from templates
- Built-in axogen run howto documentation system
Documentation & Requirements
- Rust edition 2024 requirement documented (requires Rust 1.92.0+)
- Node.js 16+ standardized across documentation
- Comprehensive DEVELOPMENT.md with setup, build, test, and contribution guidelines
- Crate-level README for better crates.io presentation
Changes
- Repository reorganized into workspace with crates/xpatch, crates/xpatch-python, crates/xpatch-node
- Improved licensing documentation and philosophy explanation
- Enhanced README flow and clarity
Full Changelog
See https://github.com/ImGajeed76/xpatch/blob/master/CHANGELOG.md for complete details.
GitHub Changelog: v0.2.0...v0.3.1
v0.2.0 - Tag Optimization & Real-World Benchmarks
🎯 Highlights
- 2-byte median deltas on code repositories through intelligent tag optimization
- Tested on 1.2 million real-world git changes across tokio and mdn/content
- 88.7% smaller deltas on code vs sequential mode (tag optimization impact)
- Enhanced CLI with memory management and progress indicators
- Complete benchmark infrastructure rewrite with environment variable configuration
Performance
tokio (code):
- Median delta: 2 bytes (99.8% space saved)
- Tag optimization provides 88.7% improvement over sequential
mdn/content (docs):
- Median delta: 23 bytes (99.4% space saved)
- Tag optimization provides 8.8% improvement over sequential
Improvements
- Optimized
encode_removeto use length encoding instead of absolute positions
Full Changelog
See CHANGELOG.md for complete details.
GitHub Changelog: https://github.com/ImGajeed76/xpatch/commits/v0.2.0