Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Why Bundler 1.1 will be much faster

1,785 views

Published on

A look under the hood at exactly why Bundler 1.1 is so much faster than Bundler 1.0, and how all the great teamwork by the Bundler and RubyGems.org teams has made all of our lives easier.

Published in: Technology
  • Be the first to comment

Why Bundler 1.1 will be much faster

  1. 1. Why Bundler 1.1 will be much fasterPat Shaughnessy@pat_shaughnessyhttp://patshaughnessy.nethttp://rubysource.com
  2. 2. Don’t kill the messenger
  3. 3. (or praise)Don’t kill the messenger
  4. 4. Fetching source index for http://rubygems.org/
  5. 5. HTTPBundler 1.0 RubyGems.org Fetching source index for http://rubygems.org/
  6. 6. What is the “source index?”
  7. 7. Whats inside "specs.4.8"?
  8. 8. What about gemdependency information?
  9. 9. Example: bundle install with a very simple Gemfile
  10. 10. Bundler 1.0 RubyGems.org specs.4.8
  11. 11. Bundler 1.0 RubyGems.org specs.4.8Bundler 1.0 RubyGems.org prerelease_specs.4.8
  12. 12. Bundler 1.0 RubyGems.org specs.4.8 Bundler 1.0 RubyGems.org prerelease_specs.4.8Bundler 1.0 RubyGems.org uglifier-1.0.4.gemspec
  13. 13. Bundler 1.0 RubyGems.org specs.4.8 Bundler 1.0 RubyGems.org prerelease_specs.4.8 Bundler 1.0 RubyGems.org uglifier-1.0.4.gemspecBundler 1.0 RubyGems.org execjs-1.2.9.gemspec
  14. 14. Bundler 1.0 RubyGems.org specs.4.8 Bundler 1.0 RubyGems.org prerelease_specs.4.8 Bundler 1.0 RubyGems.org uglifier-1.0.4.gemspec Bundler 1.0 RubyGems.org execjs-1.2.9.gemspecBundler 1.0 RubyGems.org multi_json-1.0.3.gemspec
  15. 15. etc...
  16. 16. Whats the problem with this picture?
  17. 17. Bundler 1.0 downloads and parses theentire source index - not really needed
  18. 18. One HTTP request per gem during the bundler resolve algorithm
  19. 19. It turns out that most of the time isn’t spent downloading
  20. 20. Running in Ruby 1.9.3, thesame iteration is a lot faster
  21. 21. Fetching metadata from http://rubygems.org/...
  22. 22. HTTPBundler 1.1 RubyGems.org Fetching metadata from http://rubygems.org/...
  23. 23. http://rubygems.org/api/v1/dependencies?gems=...
  24. 24. Example: bundle install with a very simple Gemfile
  25. 25. uglifier
  26. 26. uglifierhttp://rubygems.org/api/v1/dependencies?gems=uglifier
  27. 27. uglifiermulti_json execjs json therubyracerhttp://rubygems.org/api/v1/dependencies?gems=uglifier
  28. 28. uglifiermulti_json execjs json therubyracer http://rubygems.org/api/v1/dependencies? gems=multi_json,execjs,json,therubyracer
  29. 29. uglifiermulti_json execjs json therubyracer multi_json libv8 http://rubygems.org/api/v1/dependencies? gems=multi_json,execjs,json,therubyracer
  30. 30. uglifiermulti_json execjs json therubyracer libv8 http://rubygems.org/api/v1/dependencies?gems=libv8
  31. 31. uglifiermulti_json execjs json therubyracer libv8 [ Empty ] http://rubygems.org/api/v1/dependencies?gems=libv8
  32. 32. This is faster because...
  33. 33. 3 HTTP requests, instead of many more
  34. 34. Each HTTP request was very, very fast
  35. 35. People worked together tomake all of our lives easier!
  36. 36. Why Bundler 1.1 will be much fasterPat Shaughnessy@pat_shaughnessyhttp://patshaughnessy.nethttp://rubysource.com
  37. 37. bundle outdatedbundle outdated --pre
  38. 38. bundle clean
  39. 39. bundle install --standalone

×