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

Add fallback for upstream version fetching #1

Closed
zekroTJA opened this issue May 4, 2023 · 1 comment
Closed

Add fallback for upstream version fetching #1

zekroTJA opened this issue May 4, 2023 · 1 comment

Comments

@zekroTJA
Copy link
Owner

zekroTJA commented May 4, 2023

Currently, the upstream version fetching relies on the git ls-remote command. There should be a fallback in place when git is not available on the system which queries tags via the GitHub Rest API.

@zekroTJA
Copy link
Owner Author

zekroTJA commented May 5, 2023

Well, fetching the list of tags via the REST API is actually way faster than using git ls-remote --tags. So, the default behavior will be the REST API request and git ls-remote --tags will be used as fallback if the API request fails.

Here you can see the results of benchmarking goup lsr using hyperfine with 3 warmup runs and 20 benchmark runs.

Command Mean [ms] Min [ms] Max [ms] Relative
lsr (git ls-remote --tags) 372.5 ± 25.8 345.9 469.2 1.00
lsr (GitHub API) 73.9 ± 77.3 38.3 335.3 1.00
lsr (GitHub API + git fallback) 71.9 ± 70.5 38.6 292.3 1.00

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

1 participant