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

Churn calculation is slow and I can't know why #490

Open
federicoaldunate opened this issue May 20, 2024 · 8 comments
Open

Churn calculation is slow and I can't know why #490

federicoaldunate opened this issue May 20, 2024 · 8 comments

Comments

@federicoaldunate
Copy link

Context

I'm trying to run rubycritic in a legacy project. Git history might be big

Issue

It's stuck in running churn.
There is no verbose option so I cannot understand why is stuck.

..........................................................................................................................................................................................................................................................................................................................................................................................................................................................
running churn

It would be nice to know how to debug this issue.

@aseroff
Copy link

aseroff commented May 28, 2024

Git history might be big

That'll do it.

@hemalvarambhia
Copy link

Are there ways of making the computation of churn faster?

@hemalvarambhia
Copy link

I found this gem by Dan Mayer (see Churn's Github page) and found it was a lot faster. I use rubycritic on some repositories and some take 15+ minutes. Can using the said gem happen?

@etagwerker
Copy link
Collaborator

@hemalvarambhia Yes, I think that would be a good idea. One question about churn, does it support all the SCMs that RubyCritic supports? (Perforce, Git, Mercurial)

I'd like to make it faster while not removing support for any SCMs: https://github.com/whitesmith/rubycritic/tree/7de7682cf979116e681b03c02b79eede5e83c855/lib/rubycritic/source_control_systems

Do you think that would be possible?

I see that churn may not have support for Perforce or Mercurial: https://github.com/danmayer/churn/tree/main/lib/churn/scm

I'm still open to a solution that uses churn for Git repositories and our current implementation for other SCMs.

Let me know!

@hemalvarambhia
Copy link

hemalvarambhia commented Dec 2, 2024

@etagwerker

I'm still open to a solution that uses churn for Git repositories and our current implementation for other SCMs.

I'd love that. I could imagine that we need to refactor the rubycritic to enable integration. I would love to refactor the code to integrate churn. To address your concern about not removing support for any SCMs, I imagine, for git, rubycritic uses churn but falls back to the current implementation for the other SCMs like so:

if git
# do the new thing
else
# do the old thing

Then, as churn adds other SCMs (maybe we contribute to their gem!), we just update the if until else is no longer executed.

How does that sound?

@hemalvarambhia
Copy link

hemalvarambhia commented Dec 2, 2024

@etagwerker

I see that churn may not have support for Perforce or Mercurial: https://github.com/danmayer/churn/tree/main/lib/churn/scm

Perhaps hg_analyzer may be the mercurial one. If I were to do this, I'd happily make sure that churn can be integrated for our mercurial users. Is that OK?

@etagwerker
Copy link
Collaborator

Perhaps hg_analyzer may be the mercurial one. If I were to do this, I'd happily make sure that churn can be integrated for our mercurial users. Is that OK?

I'm not familiar with hg_analyzer but I'm on board if rubycritic starts using churn for churn calculation.

@hemalvarambhia
Copy link

Cool. I will try to drive this one. I will have a look at a code of conduct to understand my bounded context :)

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

No branches or pull requests

4 participants