Skip to content

perf: speed up self-update by calling /releases/latest api instead of /releases#4619

Merged
jdx merged 1 commit into
jdx:mainfrom
vemoo:main
Mar 12, 2025
Merged

perf: speed up self-update by calling /releases/latest api instead of /releases#4619
jdx merged 1 commit into
jdx:mainfrom
vemoo:main

Conversation

@vemoo

@vemoo vemoo commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

Using ReleaseList ends up calling https://api.github.com/repos/jdx/mise/releases but it was only being used to get the latest version.

Now Update is reused which has a get_latest_release that calls https://api.github.com/repos/jdx/mise/releases/latest.

As reference this are the sizes of the responses of each of the endpoints

This are the results before and after in my case:

before:

➤ time mise self-update
Checking target-arch... mise-v2025.3.2-linux-x64.tar.gz
Checking current version... v2025.3.2
Checking latest released version... mise is already up to date
mise plugin:dotnet   ✓ https://github.com/mise-plugins/mise-dotnet.git#162124c
________________________________________________________
Executed in    7.17 secs      fish           external
   usr time  146.07 millis    0.65 millis  145.42 millis
   sys time   82.81 millis    1.22 millis   81.58 millis

after:

➤ time mise self-update
Checking target-arch... mise-v2025.3.2-linux-x64.tar.gz
Checking current version... v2025.3.2
Checking latest released version... mise is already up to date
mise plugin:dotnet   ✓ https://github.com/mise-plugins/mise-dotnet.git#162124c
________________________________________________________
Executed in    1.96 secs      fish           external
   usr time   67.64 millis  891.00 micros   66.74 millis
   sys time   52.84 millis  939.00 micros   51.90 millis

It still takes longer than what I would expect, considering the time mise upgrade takes:

➤ mise ls --current
Tool   Version  Source                      Requested
bun    1.2.5    ~/.config/mise/config.toml  latest
deno   2.2.3    ~/.config/mise/config.toml  latest
node   22.14.0  ~/.config/mise/config.toml  lts
usage  2.0.5    ~/.config/mise/config.toml  latest
➤ rm -r ~/.cache/mise/
➤ time mise upgrade
mise All tools are up to date

________________________________________________________
Executed in  171.74 millis    fish           external
   usr time   19.08 millis    0.00 micros   19.08 millis
   sys time   17.74 millis  737.00 micros   17.00 millis

@vemoo vemoo changed the title speed up self-update by calling /releases/latest api instead of /latest perf: speed up self-update by calling /releases/latest api instead of /latest Mar 12, 2025
@vemoo vemoo changed the title perf: speed up self-update by calling /releases/latest api instead of /latest perf: speed up self-update by calling /releases/latest api instead of /releases Mar 12, 2025
@jdx jdx merged commit 97d5305 into jdx:main Mar 12, 2025
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.

2 participants