Last active
August 29, 2015 13:56
-
-
Save danielsdeleo/9220660 to your computer and use it in GitHub Desktop.
Another crack at loading ruby apps faster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
parser = Bundler::LockfileParser.new(IO.read("Gemfile.lock")) | |
gem_activates = parser.specs.map {|s| %Q|gem "#{s.name}", "= #{s.version}"|} | |
preamble = "#TODO setup gem paths\n" | |
File.open("activate.rb", "w+") do |f| | |
f << preamble | |
f << gem_activates.join("\n") | |
f << "\n" | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "chef", "= 11.10.4" | |
gem "activesupport", "= 3.2.16" | |
gem "builder", "= 3.2.2" | |
gem "chef-zero", "= 1.7.3" | |
gem "coderay", "= 1.1.0" | |
gem "diff-lcs", "= 1.2.5" | |
gem "docile", "= 1.1.2" | |
gem "erubis", "= 2.7.0" | |
gem "hashie", "= 2.0.5" | |
gem "highline", "= 1.6.20" | |
gem "i18n", "= 0.6.9" | |
gem "ipaddress", "= 0.8.0" | |
gem "json", "= 1.8.1" | |
gem "method_source", "= 0.8.2" | |
gem "mime-types", "= 1.25.1" | |
gem "mixlib-authentication", "= 1.3.0" | |
gem "mixlib-cli", "= 1.4.0" | |
gem "mixlib-config", "= 2.1.0" | |
gem "mixlib-log", "= 1.6.0" | |
gem "mixlib-shellout", "= 1.3.0" | |
gem "moneta", "= 0.6.0" | |
gem "multi_json", "= 1.8.4" | |
gem "net-ssh", "= 2.8.0" | |
gem "net-ssh-gateway", "= 1.2.0" | |
gem "net-ssh-multi", "= 1.2.0" | |
gem "ohai", "= 6.20.0" | |
gem "pry", "= 0.9.12.6" | |
gem "puma", "= 1.6.3" | |
gem "rack", "= 1.5.2" | |
gem "rake", "= 10.1.1" | |
gem "rest-client", "= 1.6.7" | |
gem "rspec", "= 2.14.1" | |
gem "rspec-core", "= 2.14.7" | |
gem "rspec-expectations", "= 2.14.5" | |
gem "rspec-mocks", "= 2.14.5" | |
gem "rspec_junit_formatter", "= 0.1.6" | |
gem "simplecov", "= 0.8.2" | |
gem "simplecov-html", "= 0.8.0" | |
gem "slop", "= 3.4.7" | |
gem "systemu", "= 2.5.2" | |
gem "yajl-ruby", "= 1.2.0" | |
gem "yard", "= 0.8.7.3" | |
require 'chef' | |
__END__ | |
time ruby activate.rb | |
ruby activate.rb 0.72s user 0.13s system 99% cpu 0.854 total |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef' | |
__END__ | |
time ruby control.rb | |
ruby control.rb 1.85s user 0.21s system 99% cpu 2.057 total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment