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:
houseme
2026-08-26 21:36:43 +08:00
parent 2ada8a5cfb
commit ec9aabcf00
9 changed files with 43 additions and 24 deletions
Generated
+3
View File
@@ -91,6 +91,7 @@ dependencies = [
"const-random",
"getrandom 0.3.4",
"once_cell",
"serde",
"version_check",
"zerocopy",
]
@@ -9716,6 +9717,7 @@ dependencies = [
name = "rustfs-filemeta"
version = "1.0.0-rc.3"
dependencies = [
"ahash",
"arc-swap",
"byteorder",
"bytes",
@@ -10751,6 +10753,7 @@ dependencies = [
name = "rustfs-utils"
version = "1.0.0-rc.3"
dependencies = [
"ahash",
"base64-simd",
"blake2",
"brotli",