| Crates.io | rez-next-version |
| lib.rs | rez-next-version |
| version | 0.1.0 |
| created_at | 2025-06-22 18:18:18.381727+00 |
| updated_at | 2025-06-22 18:18:18.381727+00 |
| description | Ultra-fast version parsing and comparison with 117x performance improvement - core component of Rez-Next |
| homepage | https://github.com/loonghao/rez-next |
| repository | https://github.com/loonghao/rez-next |
| max_upload_size | |
| id | 1721839 |
| size | 144,900 |
โก Lightning-fast version parsing and comparison with zero-copy state machine
The fastest version parsing library in the Rust ecosystem, delivering 117x performance improvement over traditional implementations.
[dependencies]
rez-next-version = "0.1.0"
# With Python bindings
rez-next-version = { version = "0.1.0", features = ["python-bindings"] }
# With serde support
rez-next-version = { version = "0.1.0", features = ["serde"] }
use rez_next_version::Version;
// Lightning-fast parsing
let version = Version::parse("2.1.0-beta.1+build.123")?;
println!("Version: {}", version); // "2.1.0-beta.1+build.123"
// Instant comparisons
let v1 = Version::parse("1.0.0")?;
let v2 = Version::parse("2.0.0")?;
assert!(v1 < v2);
// Version ranges
let range = VersionRange::parse(">=1.0.0,<2.0.0")?;
assert!(range.contains(&Version::parse("1.5.0")?));
from rez_next_version import Version
# Same blazing performance in Python
version = Version("2.1.0-beta.1")
print(f"Major: {version.major}") # 2
print(f"Minor: {version.minor}") # 1
print(f"Patch: {version.patch}") # 0
# Fast comparisons
versions = [Version("1.0.0"), Version("2.0.0"), Version("1.5.0")]
sorted_versions = sorted(versions)
Traditional Parser: 1,000 versions/ms
rez-next Version: 586,633 versions/s
Improvement: 117x faster
Traditional Parser: ~200 bytes/version
rez-next Version: ~48 bytes/version
Improvement: 75% reduction
Traditional Parser: ~10,000 comparisons/ms
rez-next Version: ~2,000,000 comparisons/ms
Improvement: 200x faster
pub struct StateMachineParser {
// Optimized state transitions
// No heap allocations during parsing
// SIMD-accelerated character processing
}
pub enum VersionToken {
Numeric(u32), // Fast integer parsing
AlphaNumeric(String), // Minimal string allocation
Separator(char), // Single character
}
pub struct VersionCache {
// LRU cache for parsed versions
// Predictive preheating
// Memory-efficient storage
}
use rez_next_version::VersionRange;
let range = VersionRange::parse(">=1.0.0,<2.0.0")?;
let intersection = range1.intersect(&range2)?;
let union = range1.union(&range2)?;
use rez_next_version::VersionParser;
let parser = VersionParser::new()
.with_strict_mode(true)
.with_custom_separators(&['.', '-', '_']);
let version = parser.parse("1.0.0-custom_build")?;
use rez_next_version::batch;
let versions = vec!["1.0.0", "2.0.0", "1.5.0"];
let parsed = batch::parse_versions(&versions)?;
let sorted = batch::sort_versions(parsed);
Run the comprehensive test suite:
# Unit tests
cargo test
# Performance benchmarks
cargo bench
# Property-based testing
cargo test --features proptest
# Python integration tests
cargo test --features python-bindings
# Development build
cargo build
# Optimized release
cargo build --release
# With all features
cargo build --all-features
# Python bindings
cargo build --features python-bindings
# Install flamegraph
cargo install flamegraph
# Profile parsing performance
flamegraph -- cargo bench version_parsing
# Profile memory usage
cargo bench --features dhat-heap
We welcome contributions! Areas where help is needed:
See CONTRIBUTING.md for details.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
โญ Star us on GitHub if you find rez-next-version useful! โญ