Skip to content
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

investigate converting graph hashmap into an MRU/LRU #1218

Closed
JimFuller-RedHat opened this issue Jan 30, 2025 · 3 comments
Closed

investigate converting graph hashmap into an MRU/LRU #1218

JimFuller-RedHat opened this issue Jan 30, 2025 · 3 comments
Assignees

Comments

@JimFuller-RedHat
Copy link
Collaborator

JimFuller-RedHat commented Jan 30, 2025

Which will naturally partition data along the memory and/or temporal axis.

Specifically we want to investigate (maybe an ADR) on using something like this https://crates.io/crates/lru on analysis graph hashmap.

@chirino
Copy link
Contributor

chirino commented Jan 30, 2025

did a little searching, and found https://github.com/marmeladema/clru-rs which is a weighted lru. Does anyone have better options?

@JimFuller-RedHat
Copy link
Collaborator Author

comment: this recent fix #1211 fixed graph hashmap to actually persist a graph eg. in some previous work broke it and were actually (lazily) continually reloading graphs into memory.

@chirino
Copy link
Contributor

chirino commented Jan 31, 2025

Took a peek at replacing the Map in the GraphMap with CLruCache. It was mostly straightforward until you got to the point where we implemented the GraphMap::get :

  • since the LRU cache needs to be updated on get to track that it was recently used, the get method needs be changed to take a &mut self ref.
  • this has the ripple effect of needing a write lock instead of read lock in query_graph.

I don't think we want to do that. You don't want your read path to serialize on a writelock. Is there a better way to restructure this?

Or should we be looking at more complex cache implementations like https://github.com/moka-rs/moka ?

@chirino chirino self-assigned this Jan 31, 2025
chirino added a commit to chirino/trustify that referenced this issue Jan 31, 2025
chirino added a commit to chirino/trustify that referenced this issue Jan 31, 2025
chirino added a commit to chirino/trustify that referenced this issue Jan 31, 2025
chirino added a commit to chirino/trustify that referenced this issue Jan 31, 2025
chirino added a commit to chirino/trustify that referenced this issue Feb 3, 2025
chirino added a commit to chirino/trustify that referenced this issue Feb 4, 2025
chirino added a commit to chirino/trustify that referenced this issue Feb 4, 2025
@JimFuller-RedHat JimFuller-RedHat moved this from Backlog to Done in Trustify Feb 4, 2025
@JimFuller-RedHat JimFuller-RedHat closed this as completed by moving to Done in Trustify Feb 4, 2025
@ptomanRH ptomanRH added this to the RHTPA 2.0.0 milestone Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants