jdx/mise

`mise ls` got a lot slower recently (possibly because of online version checks)

dhanak opened this issue · 2 comments

Description

I'm using zsh with a smart prompt, which displays the current, non-global mise tool versions (among other things), a la this thread. To this end, mise ls --current is invoked for every prompt. Until recently, this was not an issue, mise ran blazingly fast. A recent change, however, caused a significant slowdown in mise ls --current, sometimes it takes seconds to run. I'm guessing that is checks the available versions online, and this is the reason for the slowdown. Note that I have thirty-odd tools set up with mise, and 18 of them use latest as the version spec.

I was wondering if there is a way to run this (or a similar) command without online version checks, i.e., I just need it to display the currently used versions, without being too smart about it. I just don't want to duplicate the effort of parsing the toml files.

Note that this also freaks out the GitHub API, I had to set up a private token to get around the API rate limiter.

Output of mise dr

version: 2024.11.1 linux-x64 (4927c37 2024-11-05)
activated: yes
shims_on_path: no

build_info:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Tue, 5 Nov 2024 02:08:06 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-debian-linux-gnu)

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/.config/mise/config.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  bat         https://gitlab.com/wt0f/asdf-bat#64022b1
  cmake       https://github.com/asdf-community/asdf-cmake.git#9959904
  elixir      https://github.com/mise-plugins/mise-elixir.git#8efb115
  elixir-ls   https://github.com/juantascon/asdf-elixir-ls.git#faf921f
  eza         https://github.com/lwiechec/asdf-eza.git#11f578d
  fd          https://gitlab.com/wt0f/asdf-fd.git#17d56e0
  flatc       https://github.com/TheOpenDictionary/asdf-flatc.git#4145b83
  jlpkg       https://github.com/fredrikekre/asdf-jlpkg#36f1e9c
  julia       https://github.com/rkyleg/asdf-julia.git#52222ed
  lazydocker  https://github.com/comdotlinux/asdf-lazydocker.git#abb6f71
  protoc      https://github.com/paxosglobal/asdf-protoc.git#a44c5cd
  rebar       https://github.com/Stratus3D/asdf-rebar.git#827ef1b
  usage       https://github.com/jdx/mise-usage.git#fe3888a
  vale        https://github.com/pdemagny/asdf-vale.git#9926c81
  vhs         https://github.com/chessmango/asdf-vhs.git#2403f6d

toolset:
  cargo:mdcat@2.5.0
  cargo:ouch@0.5.1
  cmake@3.24.4
  bat@0.24.0
  ubi:dandavison/delta@0.18.2
  elixir@1.17.3-otp-25
  elixir-ls@0.24.1
  erlang@25.0
  erlang@23.2.1
  eza@0.20.6
  fd@10.2.0
  ubi:junegunn/fzf@0.56.0
  go@1.22.8
  java@22.0.2
  julia@1.11.1
  julia@1.10.6
  julia@1.8.5
  julia@1.7.3
  julia@1.6.7
  jlpkg@1.5.1
  lazydocker@0.23.3
  node@21.7.3
  python@3.12.7
  rebar@3.20.0
  rebar@3.16.1
  ubi:BurntSushi/ripgrep@14.1.1
  ruby@3.3.6
  ubi:starship/starship@1.21.1
  ubi:tomnomnom/gron@0.7.1
  ubi:brimdata/zq@1.18.0
  usage@1.2.0
  vale@3.8.0
  vhs@0.3.0

env_vars:
  MISE_SHELL=zsh

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cache_prune_age = "30d"
  ci = false
  color = true
  debug = false
  disable_backends = []
  disable_default_registry = false
  disable_hints = []
  disable_tools = []
  experimental = true
  fetch_remote_versions_cache = "1h"
  fetch_remote_versions_timeout = "10s"
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = "30s"
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  lockfile = false
  log_level = "info"
  not_found_auto_install = false
  paranoid = false
  pin = false
  plugin_autoupdate_last_check_duration = "7d"
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = ["~/CI"]
  use_versions_host = true
  verbose = false
  yes = false

  [cargo]
  binstall = true

  [node]

  [pipx]
  uvx = false

  [python]
  default_packages_file = "~/.default-python-packages"
  pyenv_repo = "https://github.com/pyenv/pyenv.git"
  venv_auto_create = false
  venv_stdlib = false

  [ruby]
  default_packages_file = "~/.default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false
No warnings found
1 problem found:

1. new mise version 2024.11.2 available, currently on 2024.11.1

On a related note, it would be great if I could list the locally set versions only.

Well that was quick! Thank you very much!