Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion relay-quotas/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ where
NonZeroU64::new(max_over_spend_divisor as u64).unwrap_or(NonZeroU64::MIN);

Self {
cache: Default::default(),
cache: papaya::HashMap::builder()
// `ahash` for a faster hasher
.hasher(ahash::RandomState::new())
// Blocking resizes help with iteration, which we need for cleanups,
// as well as our workload seems to match the description of `Blocking`
// very well.
.resize_mode(papaya::ResizeMode::Blocking)
.build(),
max_over_spend_divisor,
limit_max_divisor: None,
vacuum_interval: Duration::from_secs(30),
Expand Down
Loading