-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use papaya instead of dashmap #356
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #356 will not alter performanceComparing Summary
|
Out of curiosity, are the benchmark results any better if you create the papaya::HashMap::builder()
.resize_mode(papaya::ResizeMode::Blocking)
.collector(seize::Collector::new().epoch_frequency(None))
.build() By default, |
@ibraheemdev Trying out the throughput-optimized configuration too. Just to clarify: Can the memory spikes be caused by stalled threads, even if they're not holding on to a pin? |
@arendjr No, the issue would be a thread holding on to a guard without dropping it. Epochs detect stalled threads and allow finer-grained reclamation of objects that they haven't accessed yet. This would be useful when holding a guard on an iterator, for example. |
This PR replaces uses of
dashmap
in theCache
withpapaya
: https://github.com/ibraheemdev/papaya/papaya
is designed for read-heavy workloads, which seems quite fitting for your caching use case. We've also switched to it in Biome and are getting good results.Note this PR currently depends on an unmerged feature I proposed, so I'm leaving it in Draft until this is merged: ibraheemdev/papaya#45
Performance results on my machine:
So a roughly 10~11% speedup on the first two benchmarks, and almost 7% on the one involving symlinks.