@ledsun blog

Hのキーがhellで、Sのキーがslaveだ、と彼は思った。そしてYのキーがyouだ。

bundle outdatedに35分掛かる

次のリポジトリで、bundle outdatedを実行すると35分掛かりました。

github.com

~ time bundle outdated
Fetching https://github.com/plataformatec/devise
Fetching https://github.com/jdkim/stardog-rb.git
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Outdated gems included in the bundle:
  * actionmailer (newest 6.1.3.1, installed 3.2.22.2)
  * actionpack (newest 6.1.3.1, installed 3.2.22.2)
  * activemodel (newest 6.1.3.1, installed 3.2.22.2)
  * activerecord (newest 6.1.3.1, installed 3.2.22.2)
  * activerecord-import (newest 1.0.8, installed 0.15.0, requested ~> 0.15.0) in groups "default"
  * activeresource (newest 5.1.1, installed 3.2.22.2)
  * activesupport (newest 6.1.3.1, installed 3.2.22.2)
  * arel (newest 9.0.0, installed 3.0.3)
  * backports (newest 3.21.0, installed 3.18.1)
  * backup (newest 4.4.1, installed 3.4.0) in groups "default"
  * bcrypt (newest 3.1.16, installed 3.1.15)
  * builder (newest 3.2.4, installed 3.0.4)
  * coffee-rails (newest 5.0.0, installed 3.2.2, requested ~> 3.2.1) in groups "assets"
  * concurrent-ruby (newest 1.1.8, installed 1.1.7)
  * crack (newest 0.4.5, installed 0.4.3)
  * cucumber (newest 5.3.0, installed 3.2.0) in groups "test"
  * cucumber-core (newest 9.0.0, installed 3.2.1)
  * cucumber-expressions (newest 8.3.0, installed 6.0.1)
  * cucumber-tag_expressions (newest 2.0.2, installed 1.1.1)
  * cucumber-wire (newest 4.0.1, installed 0.0.1)
  * database_cleaner (newest 2.0.1, installed 1.8.5) in groups "test"
  * delayed_job (newest 4.1.9, installed 4.1.8)
  * delayed_job_active_record (newest 4.1.6, installed 4.1.4) in groups "default"
  * docile (newest 1.3.5, installed 1.3.2)
  * elasticsearch (newest 7.12.0, installed 5.0.5)
  * elasticsearch-api (newest 7.12.0, installed 5.0.5)
  * elasticsearch-model (newest 7.1.1, installed 5.1.0, requested ~> 5.1.0) in groups "default"
  * elasticsearch-rails (newest 7.1.1, installed 5.1.0, requested ~> 5.1.0) in groups "default"
  * elasticsearch-transport (newest 7.12.0, installed 5.0.5)
  * em-websocket (newest 0.5.2, installed 0.5.1)
  * faraday (newest 1.3.0, installed 1.0.1)
  * ffi (newest 1.15.0, installed 1.13.1)
  * font-awesome-rails (newest 4.7.0.7, installed 4.7.0.5) in groups "default"
  * friendly_id (newest 5.4.2, installed 4.0.10.1) in groups "default"
  * gherkin (newest 9.0.0, installed 5.1.0)
  * hashie (newest 4.1.0, installed 3.6.0)
  * hike (newest 2.1.3, installed 1.2.3)
  * http-accept (newest 2.1.1, installed 1.7.0)
  * i18n (newest 1.8.10, installed 0.9.5)
  * jquery-rails (newest 4.4.0, installed 3.1.5) in groups "default"
  * json (newest 2.5.1, installed 1.8.6)
  * kaminari (newest 1.2.1, installed 0.17.0) in groups "default"
  * libxml-ruby (newest 3.2.1, installed 3.2.0) in groups "default"
  * listen (newest 3.5.1, installed 3.2.1)
  * lumberjack (newest 1.2.8, installed 1.2.7)
  * mail (newest 2.7.1, installed 2.5.5)
  * mime-types (newest 3.3.1, installed 1.25.1)
  * mini_portile2 (newest 2.5.0, installed 2.4.0)
  * nokogiri (newest 1.11.3, installed 1.10.10)
  * oauth2 (newest 1.4.7, installed 1.4.4)
  * omniauth (newest 2.0.4, installed 1.4.2) in groups "default"
  * omniauth-google-oauth2 (newest 1.0.0, installed 0.7.0) in groups "default"
  * omniauth-oauth2 (newest 1.7.1, installed 1.5.0)
  * pg (newest 1.2.3, installed 0.21.0, requested ~> 0.11) in groups "default"
  * power_assert (newest 2.0.0, installed 1.2.0)
  * pry (newest 0.14.0, installed 0.13.1)
  * public_suffix (newest 4.0.6, installed 4.0.5)
  * rack (newest 2.2.3, installed 1.4.7)
  * rack-cache (newest 1.12.1, installed 1.12.0)
  * rack-ssl (newest 1.4.1, installed 1.3.4)
  * rack-test (newest 1.1.0, installed 0.6.3)
  * rails (newest 6.1.3.1, installed 3.2.22.2, requested = 3.2.22.2) in groups "default"
  * railties (newest 6.1.3.1, installed 3.2.22.2)
  * rake (newest 13.0.3, installed 10.5.0, requested < 11.0) in groups "default"
  * rdoc (newest 6.3.0, installed 3.12.2)
  * responders (newest 3.0.1, installed 1.1.2)
  * rspec (newest 3.10.0, installed 2.99.0) in groups "test"
  * rspec-core (newest 3.10.1, installed 2.99.2)
  * rspec-expectations (newest 3.10.1, installed 2.99.2)
  * rspec-mocks (newest 3.10.2, installed 2.99.4)
  * rspec-rails (newest 5.0.1, installed 2.99.0, requested ~> 2.0) in groups "test, development"
  * sass-rails (newest 6.0.0, installed 3.2.6, requested ~> 3.2.3) in groups "assets"
  * simplecov (newest 0.21.2, installed 0.19.0) in groups "test"
  * simplecov-html (newest 0.12.3, installed 0.12.2)
  * sprockets (newest 4.0.2, installed 2.2.3)
  * test-unit (newest 3.4.0, installed 3.3.6) in groups "test"
  * thor (newest 1.1.0, installed 1.0.1)
  * tilt (newest 2.0.10, installed 1.4.1)
  * treetop (newest 1.6.11, installed 1.4.15)
  * tzinfo (newest 2.0.4, installed 0.3.57)
  * unicorn (newest 6.0.0, installed 5.4.1, requested = 5.4.1) in groups "default"
  * warden (newest 1.2.9, installed 1.2.7)
  * webmock (newest 3.12.2, installed 1.9.3, requested < 1.10.0) in groups "test"
  * wice_grid (newest 4.1.0, installed 3.6.2) in groups "default"
  * wikipedia-client (newest 1.12.0, installed 1.10.0) in groups "default"
________________________________________________________
Executed in   35.73 mins    fish           external
   usr time   35.40 mins  147.00 micros   35.40 mins
   sys time    0.15 mins  635.00 micros    0.15 mins

Gemfileの次の行をコメントアウトします。

gem 'jquery-rails'

72秒で終わります。

~ time bundle outdated
Fetching https://github.com/plataformatec/devise
Fetching https://github.com/jdkim/stardog-rb.git
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...........................................................................................................................................................................................................................................................................................................................................

Outdated gems included in the bundle:
  * actionmailer (newest 6.1.3.1, installed 3.2.22.2)
  * actionpack (newest 6.1.3.1, installed 3.2.22.2)
  * activemodel (newest 6.1.3.1, installed 3.2.22.2)
  * activerecord (newest 6.1.3.1, installed 3.2.22.2)
  * activerecord-import (newest 1.0.8, installed 0.15.0, requested ~> 0.15.0) in groups "default"
  * activeresource (newest 5.1.1, installed 3.2.22.2)
  * activesupport (newest 6.1.3.1, installed 3.2.22.2)
  * arel (newest 9.0.0, installed 3.0.3)
  * backports (newest 3.21.0, installed 3.18.1)
  * backup (newest 4.4.1, installed 3.4.0) in groups "default"
  * bcrypt (newest 3.1.16, installed 3.1.15)
  * builder (newest 3.2.4, installed 3.0.4)
  * coffee-rails (newest 5.0.0, installed 3.2.2, requested ~> 3.2.1) in groups "assets"
  * concurrent-ruby (newest 1.1.8, installed 1.1.7)
  * crack (newest 0.4.5, installed 0.4.3)
  * cucumber (newest 5.3.0, installed 3.2.0) in groups "test"
  * cucumber-core (newest 9.0.0, installed 3.2.1)
  * cucumber-expressions (newest 8.3.0, installed 6.0.1)
  * cucumber-tag_expressions (newest 2.0.2, installed 1.1.1)
  * cucumber-wire (newest 4.0.1, installed 0.0.1)
  * database_cleaner (newest 2.0.1, installed 1.8.5) in groups "test"
  * delayed_job (newest 4.1.9, installed 4.1.8)
  * delayed_job_active_record (newest 4.1.6, installed 4.1.4) in groups "default"
  * docile (newest 1.3.5, installed 1.3.2)
  * elasticsearch (newest 7.12.0, installed 5.0.5)
  * elasticsearch-api (newest 7.12.0, installed 5.0.5)
  * elasticsearch-model (newest 7.1.1, installed 5.1.0, requested ~> 5.1.0) in groups "default"
  * elasticsearch-rails (newest 7.1.1, installed 5.1.0, requested ~> 5.1.0) in groups "default"
  * elasticsearch-transport (newest 7.12.0, installed 5.0.5)
  * em-websocket (newest 0.5.2, installed 0.5.1)
  * faraday (newest 1.3.0, installed 1.0.1)
  * ffi (newest 1.15.0, installed 1.13.1)
  * font-awesome-rails (newest 4.7.0.7, installed 4.7.0.5) in groups "default"
  * friendly_id (newest 5.4.2, installed 4.0.10.1) in groups "default"
  * gherkin (newest 9.0.0, installed 5.1.0)
  * hashie (newest 4.1.0, installed 3.6.0)
  * hike (newest 2.1.3, installed 1.2.3)
  * http-accept (newest 2.1.1, installed 1.7.0)
  * i18n (newest 1.8.10, installed 0.9.5)
  * json (newest 2.5.1, installed 1.8.6)
  * kaminari (newest 1.2.1, installed 0.17.0) in groups "default"
  * libxml-ruby (newest 3.2.1, installed 3.2.0) in groups "default"
  * listen (newest 3.5.1, installed 3.2.1)
  * lumberjack (newest 1.2.8, installed 1.2.7)
  * mail (newest 2.7.1, installed 2.5.5)
  * mime-types (newest 3.3.1, installed 1.25.1)
  * mini_portile2 (newest 2.5.0, installed 2.4.0)
  * nokogiri (newest 1.11.3, installed 1.10.10)
  * oauth2 (newest 1.4.7, installed 1.4.4)
  * omniauth (newest 2.0.4, installed 1.4.2) in groups "default"
  * omniauth-google-oauth2 (newest 1.0.0, installed 0.7.0) in groups "default"
  * omniauth-oauth2 (newest 1.7.1, installed 1.5.0)
  * pg (newest 1.2.3, installed 0.21.0, requested ~> 0.11) in groups "default"
  * power_assert (newest 2.0.0, installed 1.2.0)
  * pry (newest 0.14.0, installed 0.13.1)
  * public_suffix (newest 4.0.6, installed 4.0.5)
  * rack (newest 2.2.3, installed 1.4.7)
  * rack-cache (newest 1.12.1, installed 1.12.0)
  * rack-ssl (newest 1.4.1, installed 1.3.4)
  * rack-test (newest 1.1.0, installed 0.6.3)
  * rails (newest 6.1.3.1, installed 3.2.22.2, requested = 3.2.22.2) in groups "default"
  * railties (newest 6.1.3.1, installed 3.2.22.2)
  * rake (newest 13.0.3, installed 10.5.0, requested < 11.0) in groups "default"
  * rdoc (newest 6.3.0, installed 3.12.2)
  * responders (newest 3.0.1, installed 1.1.2)
  * rspec (newest 3.10.0, installed 2.99.0) in groups "test"
  * rspec-core (newest 3.10.1, installed 2.99.2)
  * rspec-expectations (newest 3.10.1, installed 2.99.2)
  * rspec-mocks (newest 3.10.2, installed 2.99.4)
  * rspec-rails (newest 5.0.1, installed 2.99.0, requested ~> 2.0) in groups "test, development"
  * sass-rails (newest 6.0.0, installed 3.2.6, requested ~> 3.2.3) in groups "assets"
  * simplecov (newest 0.21.2, installed 0.19.0) in groups "test"
  * simplecov-html (newest 0.12.3, installed 0.12.2)
  * sprockets (newest 4.0.2, installed 2.2.3)
  * test-unit (newest 3.4.0, installed 3.3.6) in groups "test"
  * thor (newest 1.1.0, installed 1.0.1)
  * tilt (newest 2.0.10, installed 1.4.1)
  * treetop (newest 1.6.11, installed 1.4.15)
  * tzinfo (newest 2.0.4, installed 0.3.57)
  * unicorn (newest 6.0.0, installed 5.4.1, requested = 5.4.1) in groups "default"
  * warden (newest 1.2.9, installed 1.2.7)
  * webmock (newest 3.12.2, installed 1.9.3, requested < 1.10.0) in groups "test"
  * wice_grid (newest 4.1.0, installed 3.6.2) in groups "default"
  * wikipedia-client (newest 1.12.0, installed 1.10.0) in groups "default"

________________________________________________________
Executed in   72.08 secs    fish           external
   usr time   69.86 secs  138.00 micros   69.86 secs
   sys time    0.94 secs  877.00 micros    0.94 secs

30倍速くなりました。 謎です。

bundle outdated jquery-railsだけなら5秒です。

~ time bundle outdated jquery-rails
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....

Outdated gems included in the bundle:
  * jquery-rails (newest 4.4.0, installed 3.1.5) in groups "default"

________________________________________________________
Executed in    5.29 secs    fish           external
   usr time    4.70 secs  128.00 micros    4.70 secs
   sys time    0.53 secs  801.00 micros    0.53 secs

gemの組み合わせによって遅くなるようです。 bundle outdatedのロジックがイメージできないので、どういう仕組みで遅くなっているのか想像がつきません。

bundlerのバージョンは1.17.3です。

~ bundle --version
Bundler version 1.17.3