mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-07 12:35:54 +00:00
feat(fileinfo): use AHashMap for metadata fields
- Add ahash dependency to workspace, filemeta, and utils crates - Change FileInfo.metadata to AHashMap<String, String> - Change ObjectPartInfo.checksums to Option<AHashMap<String, String>> - Change MetaObjectV1.meta to AHashMap<String, String> - Change MetaObjectV1Part.checksums to Option<AHashMap<String, String>> - Change UniquePartChecksums to use AHashMap - Make metadata_compat functions generic over BuildHasher - Make get_internal_replication_state generic over BuildHasher This optimization replaces the standard library's SipHash with ahash, which provides 2-3x faster hashing for typical key types. Refs: https://github.com/rustfs/backlog/issues/2005 Co-Authored-By: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -22,6 +22,12 @@ mod replication;
|
||||
|
||||
pub mod test_data;
|
||||
|
||||
/// High-performance HashMap type alias using ahash instead of SipHash.
|
||||
pub type AHashMap<K, V> = ahash::AHashMap<K, V>;
|
||||
|
||||
/// High-performance HashSet type alias using ahash.
|
||||
pub type AHashSet<K> = ahash::AHashSet<K>;
|
||||
|
||||
pub use error::*;
|
||||
pub use fileinfo::*;
|
||||
pub use filemeta::*;
|
||||
|
||||
Reference in New Issue
Block a user