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

Optimisation: Avoid unnecessary duplicate call to expensive get_repo_map() method #3080

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

Conversation

Finndersen
Copy link

Coder calls self.get_repo_map() in get_chat_files_messages() just to determine whether the repo map is included in the prompt.
This is an expensive method and is already called immediately before get_chat_files_messages(), so that information can just be provided as an argument for efficiency.

@Finndersen Finndersen changed the title Avoid unnecessary duplicate call to expensive get_repo_map() method Optimisation: Avoid unnecessary duplicate call to expensive get_repo_map() method Jan 30, 2025
@paul-gauthier
Copy link
Collaborator

Thanks for your interest in aider and for putting together this PR.

The repo map call should be cached, so wouldn't only be slow if it needs to be recomputed.

@Finndersen
Copy link
Author

On but it still looks like there's a decent amount of code path before the cache will even be hit, so I still think this is a worthy optimisation seeing as this information will always be available before the method is called

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

Successfully merging this pull request may close these issues.

2 participants