-
Notifications
You must be signed in to change notification settings - Fork 652
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
Improve performance on repositories with a lot of tags #3585
Improve performance on repositories with a lot of tags #3585
Conversation
@AntonMTolmachev that is an impressive improvement, let's see the tests pass, then we can continue |
Thank you @AntonMTolmachev for your contribution! |
@AntonMTolmachev : I've the same problem with one of my repo that has lots of tags, what exactly I should do to prevent reading 200+ tags? At the moment, I'm using this:
|
@sreenivas-ps this should be fixed in 6.0.0-beta3 - name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.0.0-beta.3'
includePrerelease: true |
@arturcic : thanks. I've tried using that version before but it is even taking long than 5.x. For each branch in the repo, it is cycling 236 tags ( to find merge base between) the PR and branch and then moves to next branch to find the same... e.g..
I'm not sure if i'm doing anything wrong. Here is my Gitversion.yaml file and new to this gitversion.yaml
My repo has about 236 tags. |
@sreenivas-ps I think this is a different problem from the one that appeared on my repository. The log above mentions slow performance while finding merge base between branches ( I optimized the call highlighted in the left part ( I could only suggest to create a new issue with reproduction steps. |
Description
Added a tag SHA cache into IncrementStrategyFinder to prevent read of all tags from repository each time when FindCommitMessageIncrement is called.
Related Issue
Fixes #3212 Fixes #2881 Fixes #2885
Motivation and Context
GitVersion runs slowly on repositories with a lot of tags when there is no gitversion_cache available.
Each tag produces a base version which goes through IncrementStrategyFinder, which in turn reads all tags from repository. This causes N^2 tags to be read from repository in total.
How Has This Been Tested?
Manually checked performance improvement via profiler on a repository with 200 commits & tags. See screenshot attached below.
A test that recreates a repository with a similar structure is provided in pull request.
Screenshots (if appropriate):
Performance before (right) and after (left).
Checklist: