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

Make include/exclude paths processing faster #640

Open
1 task done
h3adache opened this issue May 8, 2024 · 4 comments
Open
1 task done

Make include/exclude paths processing faster #640

h3adache opened this issue May 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed performance Performance related

Comments

@h3adache
Copy link

h3adache commented May 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

adding include/exclude paths results in a huge slow down.

Steps To Reproduce

  • run git-cliff in any repo with a large commit range (>= 100 commits)
  • observe that performance should be good.
  • add an include-path
  • observe a large slowdown.

I observed a huge slowdown generating a changelog for a large commit range and was able to track down the slowness to this block https://github.com/orhun/git-cliff/blob/main/git-cliff-core/src/repo.rs#L63-L91. removing the --include-path option confirmed the cause.

Expected behavior

Don't be slow? :)

Screenshots / Logs

No response

Software information

Repeatable on osx m1 and linux. does not seem to be os specific.

Additional context

No response

@h3adache h3adache added the bug Something isn't working label May 8, 2024
Copy link

welcome bot commented May 8, 2024

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun
Copy link
Owner

orhun commented May 13, 2024

Thanks for the report! I'm guessing it is due to making a lot of git2 calls and matching the glob against the list of files that are changed for each commit. I'm thinking if rayon (parallelizing) might help with regards to making things faster.

@orhun orhun added the help wanted Extra attention is needed label May 13, 2024
@orhun orhun changed the title include/exclude paths processing is very slow Make include/exclude paths processing faster May 13, 2024
@h3adache
Copy link
Author

Right that's one way to do it. I wonder if the library that is used to get the git commits already has a way to handle include/exclude paths using git's own built in capability

e.g.

git log --oneline -20 -- ':(top)config/**' ':(top)website/**' ':(exclude,top)website/blog/**'

@orhun orhun added the performance Performance related label May 23, 2024
@orhun
Copy link
Owner

orhun commented May 23, 2024

It is probably a good idea to check out git2 to see if it is supported: https://github.com/search?q=repo%3Arust-lang%2Fgit2-rs%20exclude&type=code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed performance Performance related
Projects
None yet
Development

No branches or pull requests

2 participants