Skip to content

Try to fix annotated tags #6959

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

Merged
merged 4 commits into from
Apr 27, 2020
Merged

Try to fix annotated tags #6959

merged 4 commits into from
Apr 27, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Apr 24, 2020

Maybe fixes #6932

@ericholscher
Copy link
Member

I think I'd like to just revert the original -- this keeps getting more complex, and I'm not sure this is actually valuable? How much faster is this than the original code?

@stsewd
Copy link
Member Author

stsewd commented Apr 27, 2020

@ericholscher the original code opens a file and iterates over till it finds a match for each tag. The complexity grows in O(n^2) (n is the number of tags), and opening files n^2 times as well.

https://github.com/gitpython-developers/GitPython/blob/e236853b14795edec3f09c50ce4bb0c4efad6176/git/refs/symbolic.py#L125-L135

https://github.com/gitpython-developers/GitPython/blob/e236853b14795edec3f09c50ce4bb0c4efad6176/git/refs/symbolic.py#L85-L123

This consumes a lot of build time for projects with a lot of tags (and it makes syncs slow too), not sure if the new builders can handle this better.

@ericholscher
Copy link
Member

OK, I guess it makes sense to try and optimize this then 👍

@stsewd
Copy link
Member Author

stsewd commented Apr 27, 2020

Tested this locally, built time is almost the same as before for projects with thousands of tags (< 5 min)

@stsewd stsewd merged commit 51a5f97 into master Apr 27, 2020
@stsewd stsewd deleted the fix-annotated-tags branch April 27, 2020 21:31
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

Successfully merging this pull request may close these issues.

"Edit on Github" link broken by annotated tag
2 participants