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

RVM source script loading is slow #4738

Closed
1 task done
vfonic opened this issue Jul 18, 2019 · 2 comments
Closed
1 task done

RVM source script loading is slow #4738

vfonic opened this issue Jul 18, 2019 · 2 comments
Labels
Milestone

Comments

@vfonic
Copy link

vfonic commented Jul 18, 2019

  • Tested after doing rvm get master

Description

Here's the long version of the story:
I needed to install ruby 2.2.3 (which failed due to some OpenSSL error).
I noticed rvm's warning message that I should update rvm. (I believe the version I was using was 1.29.7, but I'm not 100% sure on that)
So, after failed ruby installation, I gave up on that, but also ran rvm remove 2.2.3 to make any cleanups.
Then I updated rvm with rvm get stable.
This is where rvm became really slow.

EDIT: I just tried rvm get 1.29.7 but didn't help.

If I comment-out source $HOME/.rvm/scripts/rvm in my ~/.zshrc, the shell becomes interactive in about 0.5s. With the line not-commented-out, it jumps to ~2s.

I also tried:

rvm cleanup all
rvm reset - this one actually made it faster, apart from when inside of projects with Gemfile (or I'd guess .ruby-version or similar)

What can I do to give you more info you might need so we can debug this further?

Environment info

ruby-2.6.3:

  system:
    uname:        "Darwin Jesus.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64"
    name:         "OSX"
    version:      "10.14"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)"
    zsh:          "/bin/zsh => zsh 5.3 (x86_64-apple-darwin18.0)"
    remote_path:  "osx/10.14/x86_64"
    xcode:        "10.2.1"

  rvm:
    version:      "1.29.9 (latest)"
    updated:      "23 seconds ago"
    path:         "/Users/viktor/.rvm"
    autolibs:     "[rvm_pkg] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.6.3p62"
    date:         "2019-04-16"
    platform:     "x86_64-darwin18"
    patchlevel:   "2019-04-16 revision 67580"
    full_version: "ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]"

  homes:
    gem:          "/Users/viktor/.rvm/gems/ruby-2.6.3"
    ruby:         "/Users/viktor/.rvm/rubies/ruby-2.6.3"

  binaries:
    ruby:         "/Users/viktor/.rvm/rubies/ruby-2.6.3/bin/ruby"
    irb:          "/Users/viktor/.rvm/rubies/ruby-2.6.3/bin/irb"
    gem:          "/Users/viktor/.rvm/rubies/ruby-2.6.3/bin/gem"
    rake:         "/Users/viktor/.rvm/gems/ruby-2.6.3/bin/rake"

  environment:
    PATH:         "/Users/viktor/.rvm/gems/ruby-2.6.3/bin:/Users/viktor/.rvm/gems/ruby-2.6.3@global/bin:/Users/viktor/.rvm/rubies/ruby-2.6.3/bin:/usr/local/opt/mongodb@3.0/bin:/usr/local/opt/node@10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/viktor/Dropbox/scripts:/Users/viktor/.rvm/bin"
    GEM_HOME:     "/Users/viktor/.rvm/gems/ruby-2.6.3"
    GEM_PATH:     "/Users/viktor/.rvm/gems/ruby-2.6.3:/Users/viktor/.rvm/gems/ruby-2.6.3@global"
    MY_RUBY_HOME: "/Users/viktor/.rvm/rubies/ruby-2.6.3"
    IRBRC:        "/Users/viktor/.rvm/rubies/ruby-2.6.3/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
@vfonic
Copy link
Author

vfonic commented Jul 18, 2019

I did rvm implode and installed rvm and ruby 2.6.3 again. It seems to be fast again. :)

I'll close this issue now. If you want any more info from me for further investigation, I'm here.

@vfonic vfonic closed this as completed Jul 18, 2019
@pkuczynski pkuczynski added this to the rvm-1.29.10 milestone Jul 18, 2019
@mpapis
Copy link
Member

mpapis commented Jul 20, 2019

for whomever who hit's the slowness this is how to debug:

__rvm_unload
set -o xtrace; PS4="+ %* %F{red}%x:%I %F{green}%N:%i%F{white} %_" source ~/.rvm/scripts/rvm; set +o xtrace

please gist the results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants