chore(deps): refresh mimalloc and codec usage (#7096)

This commit is contained in:
houseme
2026-09-03 16:11:24 +08:00
committed by GitHub
parent 86ebcb325c
commit 3ab7a1921f
9 changed files with 41 additions and 41 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ http-body = { workspace = true }
http-body-util.workspace = true
url.workspace = true
uuid = { workspace = true, features = ["v4", "fast-rng", "serde", "macro-diagnostics"] }
reed-solomon-erasure = { workspace = true, features = ["simd-accel"] }
rustfs-erasure-codec = { workspace = true, features = ["simd-accel"] }
reed-solomon-simd = { workspace = true }
lazy_static.workspace = true
moka = { workspace = true, features = ["future", "sync"] }
+4 -4
View File
@@ -122,10 +122,10 @@ fn bench_encode_performance(c: &mut Criterion) {
});
group.finish();
// Test direct reed-solomon-erasure implementation for large shards (>= 512 bytes)
// Test direct rustfs-erasure-codec implementation for large shards (>= 512 bytes)
let shard_size = calc_shard_size(config.data_size, config.data_shards);
if shard_size >= 512 && config.parity_shards > 0 {
use reed_solomon_erasure::galois_8::ReedSolomon;
use rustfs_erasure_codec::galois_8::ReedSolomon;
let mut rse_group = c.benchmark_group("encode_rse_direct");
rse_group.throughput(Throughput::Bytes(config.data_size as u64));
@@ -204,10 +204,10 @@ fn bench_decode_performance(c: &mut Criterion) {
);
group.finish();
// Test direct reed-solomon-erasure decoding for large shards
// Test direct rustfs-erasure-codec decoding for large shards
let shard_size = calc_shard_size(config.data_size, config.data_shards);
if shard_size >= 512 && config.parity_shards > 0 {
use reed_solomon_erasure::galois_8::ReedSolomon;
use rustfs_erasure_codec::galois_8::ReedSolomon;
if let Ok(rs) = ReedSolomon::new(config.data_shards, config.parity_shards) {
let mut rse_group = c.benchmark_group("decode_rse_direct");
+2 -2
View File
@@ -845,7 +845,7 @@ mod tests {
use std::error::Error as _;
let error = DiskError::from(ErasureConstructionError::ModernEncoder {
source: reed_solomon_erasure::Error::TooManyShards,
source: rustfs_erasure_codec::Error::TooManyShards,
});
let io_source = error.source().expect("DiskError::Io must expose its io::Error source");
assert!(io_source.is::<io::Error>());
@@ -856,7 +856,7 @@ mod tests {
let encoder_source = construction_source
.source()
.expect("construction error must expose the encoder error");
assert!(encoder_source.is::<reed_solomon_erasure::Error>());
assert!(encoder_source.is::<rustfs_erasure_codec::Error>());
}
#[test]
+1 -1
View File
@@ -14,7 +14,7 @@
use crate::erasure::codec::workspace::RustfsCodecDecodeWorkspace;
use crate::erasure::coding::Erasure;
use reed_solomon_erasure::galois_8::ReedSolomon;
use rustfs_erasure_codec::galois_8::ReedSolomon;
use std::io;
use std::sync::{Arc, OnceLock};
+9 -9
View File
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Erasure coding implementation using reed-solomon-erasure (GF(2^8)).
//! Erasure coding implementation using rustfs-erasure-codec (GF(2^8)).
//! Supports legacy (reed-solomon-simd) for reading/healing old-version files.
//!
use bytes::{Bytes, BytesMut};
use reed_solomon_erasure::galois_8::ReedSolomon;
use reed_solomon_simd;
use rustfs_erasure_codec::galois_8::ReedSolomon;
use smallvec::SmallVec;
use std::{
collections::HashMap,
@@ -69,7 +69,7 @@ impl EncodedBlock {
}
}
const MODERN_MAX_TOTAL_SHARDS: usize = <reed_solomon_erasure::galois_8::Field as reed_solomon_erasure::Field>::ORDER;
const MODERN_MAX_TOTAL_SHARDS: usize = <rustfs_erasure_codec::galois_8::Field as rustfs_erasure_codec::Field>::ORDER;
const MODERN_REED_SOLOMON_CACHE_MAX_ENTRIES: usize = 64;
const LEGACY_REED_SOLOMON_CACHE_MAX_ENTRIES: usize = 16;
// Vec growth may retain twice the requested logical length. Keeping the logical
@@ -109,7 +109,7 @@ pub enum ErasureConstructionError {
#[error("failed to construct modern Reed-Solomon encoder")]
ModernEncoder {
#[source]
source: reed_solomon_erasure::Error,
source: rustfs_erasure_codec::Error,
},
/// The legacy encoder wrapper failed to initialize.
@@ -354,7 +354,7 @@ impl LegacyReedSolomonEncoder {
}
}
/// Reed-Solomon encoder using reed-solomon-erasure
/// Reed-Solomon encoder using rustfs-erasure-codec
pub struct ReedSolomonEncoder {
data_shards: usize,
parity_shards: usize,
@@ -372,7 +372,7 @@ impl Clone for ReedSolomonEncoder {
}
impl ReedSolomonEncoder {
fn try_new_typed(data_shards: usize, parity_shards: usize) -> Result<Self, reed_solomon_erasure::Error> {
fn try_new_typed(data_shards: usize, parity_shards: usize) -> Result<Self, rustfs_erasure_codec::Error> {
let encoder = if parity_shards > 0 {
Some(cached_modern_reed_solomon(data_shards, parity_shards)?)
} else {
@@ -445,7 +445,7 @@ impl ReedSolomonEncoder {
}
}
fn cached_modern_reed_solomon(data_shards: usize, parity_shards: usize) -> Result<Arc<ReedSolomon>, reed_solomon_erasure::Error> {
fn cached_modern_reed_solomon(data_shards: usize, parity_shards: usize) -> Result<Arc<ReedSolomon>, rustfs_erasure_codec::Error> {
let key = (data_shards, parity_shards);
let cache = MODERN_REED_SOLOMON_CACHE.get_or_init(|| RwLock::new(HashMap::new()));
@@ -1407,11 +1407,11 @@ mod tests {
#[test]
fn construction_errors_preserve_encoder_sources() {
let modern = ErasureConstructionError::ModernEncoder {
source: reed_solomon_erasure::Error::TooManyShards,
source: rustfs_erasure_codec::Error::TooManyShards,
};
assert!(
std::error::Error::source(&modern)
.and_then(|source| source.downcast_ref::<reed_solomon_erasure::Error>())
.and_then(|source| source.downcast_ref::<rustfs_erasure_codec::Error>())
.is_some()
);
+2 -2
View File
@@ -1221,7 +1221,7 @@ mod tests {
use std::error::Error as _;
let error = StorageError::from(ErasureConstructionError::ModernEncoder {
source: reed_solomon_erasure::Error::TooManyShards,
source: rustfs_erasure_codec::Error::TooManyShards,
});
let io_source = error.source().expect("StorageError::Io must expose its io::Error source");
assert!(io_source.is::<std::io::Error>());
@@ -1232,7 +1232,7 @@ mod tests {
let encoder_source = construction_source
.source()
.expect("construction error must expose the encoder error");
assert!(encoder_source.is::<reed_solomon_erasure::Error>());
assert!(encoder_source.is::<rustfs_erasure_codec::Error>());
}
// The lifecycle transition worker relies on this arm alone to suppress the