Skip to content

Commit 741110a

Browse files
committed
change blob cache hasher to rustc_hash
1 parent 614cf19 commit 741110a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ byteorder = "1.5.0"
2525
log = "0.4.22"
2626
min-max-heap = "1.3.0"
2727
path-absolutize = "3.1.1"
28-
quick_cache = "0.6.5"
28+
quick_cache = { version = "0.6.5", default-features = false }
29+
rustc-hash = "2.0.0"
2930
serde = { version = "1.0.204", optional = true, features = ["derive"] }
3031
tempfile = "3.12.0"
3132
xxhash-rust = { version = "0.8.12", features = ["xxh3"] }

src/blob_cache.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ impl Weighter<CacheKey, Item> for BlobWeighter {
3838
/// This speeds up consecutive accesses to the same blobs, improving
3939
/// read performance for hot data.
4040
pub struct BlobCache {
41-
data: Cache<CacheKey, Item, BlobWeighter>,
41+
// NOTE: rustc_hash performed best: https://fjall-rs.github.io/post/fjall-2-1
42+
/// Concurrent cache implementation
43+
data: Cache<CacheKey, Item, BlobWeighter, rustc_hash::FxBuildHasher>,
44+
45+
/// Capacity in bytes
4246
capacity: u64,
4347
}
4448

0 commit comments

Comments
 (0)