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

performance issue with RUBYGEMS_GEMDEPS when Gemfile has git repos #1354

Closed
leomao10 opened this issue Oct 10, 2015 · 4 comments
Closed

performance issue with RUBYGEMS_GEMDEPS when Gemfile has git repos #1354

leomao10 opened this issue Oct 10, 2015 · 4 comments

Comments

@leomao10
Copy link

Hi There,

I just found that when I use RUBYGEMS_GEMDEPS and there are some gems in Gemfile that is from github. All command related to rubygems will become really slow.

Here is the env I am testing:

  • Rubygem version: 2.4.8
  • Chruby version: HEAD
  • direnv version: 2.7.0

And here is the Gemfile:

ruby "2.2.2"
source "https://rubygems.org"

gem 'rake', git: "https://github.com/ruby/rake.git"
gem 'rack', git: "https://github.com/rack/rack.git"
gem 'vcr', git: "https://github.com/vcr/vcr.git"
gem 'shoulda-matchers', git: "https://github.com/thoughtbot/shoulda-matchers.git"

And here are the command I ran with time:

time bundle #after all gems installed
#=>  bundle  1.02s user 0.46s system 9% cpu 15.658 total
time gem --version
#=> gem --version  0.68s user 0.40s system 7% cpu 14.536 total
time gem list tile
#=> gem list tilt  0.85s user 0.44s system 4% cpu 29.202 total
time gem help
#=> gem help  0.72s user 0.42s system 9% cpu 12.460 total

If I use gems from rubygems.org, then these commands will back to normal:

Here is the Gemfile:

ruby "2.2.2"
source "https://rubygems.org"

gem 'multi_json'
gem 'tilt'
gem 'rack'
gem 'vcr'
gem 'shoulda-matchers'

And here are the command I ran and the time:

time bundle # After all gems installed
#=> bundle  0.41s user 0.05s system 98% cpu 0.461 total
time gem --version
#=> gem --version  0.22s user 0.03s system 98% cpu 0.261 total
time gem list tilt
#=> gem list tilt  0.37s user 0.05s system 99% cpu 0.425 total
time gem help
#=> gem help  0.22s user 0.03s system 98% cpu 0.262 total

Here is a simple repo that I use to create this issue:
https://github.com/leomao10/gemdeps_demo

Let me know if you need me to provide more information

Cheers

@leomao10 leomao10 changed the title performance issue with RUBYGEMS_GEMDEPS and gems from github performance issue with RUBYGEMS_GEMDEPS when Gemfile has git repos Oct 12, 2015
@leomao10
Copy link
Author

Tried with master branch and it behave the same.

@copiousfreetime
Copy link
Contributor

copiousfreetime commented Apr 30, 2016

Running this with ruby 2.3.1 and rubygems 2.6.4 the results are:

                  github gems   rubygems

bundle            0m5.090s      0m0.359s
gem --version     0m4.901s      0m0.172s
gem list tile     0m4.743s      0m0.230s
gem list tilt     0m4.754s      0m0.234s
gem help          0m5.161s      0m0.236s

It definitely looks like there is a performance issue there. My complete guess is that there is some automatic querying of the remote git repos going on during all the commands.

@bronzdoc
Copy link
Member

We're going to close this because it is so old, but if this problem is still happening with the latest version of RubyGems please feel free to let us know with a new issue!

@leomao10
Copy link
Author

Test again with ruby 2.7.0, don't have the same issue again 👍

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

No branches or pull requests

3 participants