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

CLRU added for git plugin #750

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

CLRU added for git plugin #750

wants to merge 1 commit into from

Conversation

aamohd
Copy link
Contributor

@aamohd aamohd commented Dec 30, 2024

12/30 - The PR has changes to the git plugin that uses an LRU cache functionality. The configurability of the size of the cache would come after the #662 changes are pulled.

@aamohd aamohd requested a review from j-lanson December 30, 2024 20:49
type GitRawCommitCache = Option<(PathBuf, ObjectId, Vec<RawCommit>)>;
type GitRawCommitCache = CLruCache<(PathBuf, ObjectId), Vec<RawCommit>>;
static CACHE: LazyLock<Mutex<GitRawCommitCache>> =
LazyLock::new(|| Mutex::new(CLruCache::new(NonZero::new(1).unwrap())));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this PR is to make the 1 you have here a configurable parameter

@@ -4,6 +4,7 @@ use crate::data::*;

use anyhow::Context;
use anyhow::Result;
use clru::CLruCache;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that the clru crate is better for this than lru? https://docs.rs/lru/latest/lru/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants