Comments (2)
Hi @gauteh! I like this idea, but I think it may be tricky to implement because the cache uses both a hashmap and a linked list internally. So while it may be fairly straightforward to swap out the current hashmap with dashmap, converting the linked list to support concurrent operations will likely be more difficult because it's implemented by hand. And then, even if both the hashmap and linked list supported concurrent operations, we would still have to ensure that their composition also supported concurrent operations correctly as well. With that being said, I'm certainly not opposed to the idea, it's just that I think it would take a good chunk of work and I'm not sure I'd be able to devote the necessary amount of time to it. I'd love to be proven wrong though if you have different thoughts on how to approach this?
from lru-rs.
For the reference, at near we are using Arc<Mutex>
as well, wrapped into this data structure:
https://github.com/near/nearcore/blob/master/utils/near-cache/src/sync.rs
from lru-rs.
Related Issues (20)
- 0.6.6 update breaks on linux-like systems with custom libc implementations HOT 2
- Implement Borrow<str> for KeyRef<std::string::String>? HOT 2
- RwLock read() usage HOT 1
- Consider replacing HashMap with HashSet HOT 1
- Use after free bug in lru crate HOT 2
- Am I able to cache egui? HOT 1
- Lifetime fix is missing from the changelog for 0.7.4 HOT 2
- Full check leak report reachable bytes HOT 1
- Method that removes an entry corresponding to the key and returns both the key and the value
- Failed to build with feature "nightly" HOT 1
- Allow more liberal closure for `get_or_insert` HOT 2
- Could we have a new version with the updated `hashbrown` (and maybe others) dependency ? HOT 2
- Support const new
- Limit by memory instead of number of items HOT 4
- Cache size 0 / Disable Cache HOT 3
- Cache key may not work HOT 5
- Debug not defined for custom BuildHasher
- Missing lifetime specifier in try_get_or_insert_mut? HOT 1
- Add `get_key_value` method
- Proposal to Integrate SIEVE Eviction Algorithm HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lru-rs.