-
Notifications
You must be signed in to change notification settings - Fork 653
Improve performance - Filter list of all tags first by those parsable to a semantic version #1374
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
Conversation
- reduces `Getting version tags from branch` time for our repository from a 100 seconds to 2.5 seconds
I didn't see any existing performance tests, I've attempted a few times to write one using |
I haven't tried it, but I think BenchmarkDotNet looks good. I'd happily accept pull requests with a few benchmark tests in it, especially if it's hooked up with some online service that can report performance degradation as Github checks to pull requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please attend to the review comments and rebase this PR onto the HEAD
of master
and it looks good to me.
}) | ||
.SelectMany(c => tags.Where(t => c.Sha == t.Target.Sha).SelectMany(t => | ||
var tags = new List<Tuple<Tag, SemanticVersion>>(); | ||
foreach(var t in this.Repository.Tags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please insert a space between foreach
and (
?
.Where(tag => !olderThan.HasValue || ((Commit) tag.PeeledTarget()).When() <= olderThan.Value) | ||
.ToList(); | ||
var allTags = new List<Tuple<Tag, SemanticVersion>>(); | ||
foreach(var tag in context.Repository.Tags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please insert a space between foreach
and (
?
IncludeReachableFrom = branch.Tip | ||
}) | ||
.SelectMany(c => tags.Where(t => c.Sha == t.Target.Sha).SelectMany(t => | ||
var tags = new List<Tuple<Tag, SemanticVersion>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please extract this tag filter logic out to a descriptive method?
Seeing how this might fix #1361, I'll ignore what I've written in the review and just go ahead and merge. A followup PR that addresses the comments would be appreciated, though. Thanks for this! |
- as requested in GitTools#1374
As requested in pull request GitTools#1374
Getting version tags from branch
time for our repositoryfrom a 100 seconds to 2.5 seconds