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

Use a cache to speed up calculations #187

Closed
Nyholm opened this issue Jan 27, 2019 · 3 comments · Fixed by #303
Closed

Use a cache to speed up calculations #187

Nyholm opened this issue Jan 27, 2019 · 3 comments · Fixed by #303

Comments

@Nyholm
Copy link
Contributor

Nyholm commented Jan 27, 2019

I just started to use this library. I have not looked into the source yet so Im sorry if I ask a weird question.

Would it be possible to use a cache to speed up execution?
What if the cache contained complexity and changes for every file in my project up until yesterday. Then when I do churn run src I will only calculate the change set between yesterday and now.

@bmitch
Copy link
Owner

bmitch commented Jan 27, 2019

Thank you for the suggestion @Nyholm

It does sound like a good idea but a couple of notes:

  • I think most people run this during a CI pipeline which probably would not have access to a cache since every run via the pipeline is essentially fresh. However, if you are running this locally over and over then a cache could be helpful.
  • If you are looking for a way to increase the performance you could limit how far back in the git history it looks. See https://github.com/bmitch/churn-php#how-to-configure and the commitsSince. Perhaps that will solve your issue?

Are you having poor performance using this tool? If so please feel free to open another issue with details. Thanks!

@Nyholm
Copy link
Contributor Author

Nyholm commented Jan 27, 2019

which probably would not have access to a cache since every run via the pipeline is essentially fresh

I know both Travis and Gitlab's CI can use caching. I mean we just started to use it here #191.

If you are looking for a way to increase the performance you could limit how far back in the git history it looks.

I tried that. My project takes about 5 minutes to run on my MacBook Pro 2018. Changing the value of commitsSince does not effect the execution time. (Only the result). I tried with 3 years and 1 week.

My project is not enormous. It is about 4.000 files with history from 5 years.


Thank you for your reply.

@villfa
Copy link
Collaborator

villfa commented Feb 11, 2021

A cache will be available from the next release (1.5.0).

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

Successfully merging a pull request may close this issue.

3 participants